27 lines
694 B
JavaScript
27 lines
694 B
JavaScript
const express = require('express');
|
|
const app = express();
|
|
const port = 2428;
|
|
|
|
const server = app.listen(port, () => console.log(`Gymrooster running on port ${port}`));
|
|
var path = require('path');
|
|
|
|
var mustacheExpress = require('mustache-express');
|
|
|
|
// Register '.mustache' extension with The Mustache Express
|
|
app.engine('mustache', mustacheExpress());
|
|
|
|
app.set('view engine', 'mustache');
|
|
app.set('views', path.resolve('views/'));
|
|
|
|
var username = 'ARN';
|
|
|
|
app.get('/', (req, res) => {
|
|
// Render index.mustache and pass username through.
|
|
res.render('index', {username: username});
|
|
});
|
|
|
|
app.get('/scss/:file', (req, res) =>
|
|
res.sendFile(path.resolve('scss/' + req.params.file));
|
|
);
|
|
|