This repository has been archived on 2020-03-05. You can view files and clone it, but cannot push or open issues or pull requests.
gymrooster/src/index.js

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));
);