Commit f709542f authored by Corentin Mors's avatar Corentin Mors
Browse files

Use MVC like model

parent e9f491ce
......@@ -14,7 +14,21 @@ server.listen(port, () => {
// Routing
app.use(express.static(path.join(__dirname, 'public')));
// Chatroom
var nunjucks = require('nunjucks');
nunjucks.configure('views', {
autoescape: true,
express: app
});
app.set('view engine', 'html');
// Call routes
app.use(require('./routes'))
// GeoChat Room
var numUsers = 0;
......
var express = require('express');
exports.dashboard = function(req, res, next) {
res.render('index');
}
\ No newline at end of file
This diff is collapsed.
......@@ -10,6 +10,7 @@
"cookie-parser": "~1.3.3",
"debug": "^4.1.0",
"express": "^4.16.4",
"nunjucks": "^3.1.6",
"socket.io": "^2.2.0"
}
}
var express = require('express'),
router = express.Router(),
indexController = require('../controllers');
router.route('/')
.get(indexController.dashboard);
module.exports = router
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment