27 lines
698 B
JavaScript
27 lines
698 B
JavaScript
let express = require('express');
|
|
let router = express.Router();
|
|
|
|
/* GET home page. */
|
|
router.get('/', function(req, res, next) {
|
|
res.render('index', { title: 'Muhahaha' });
|
|
});
|
|
|
|
router.get('/admin', function(req, res, next) {
|
|
//res.send('respond with a resource');
|
|
res.render('admin', { title: 'Muhahaha ADMIN' });
|
|
});
|
|
|
|
module.exports = router;
|
|
//Nice trick to get io into my routes, not really needed right now
|
|
// http://stackoverflow.com/questions/24609991/using-socket-io-in-express-4-and-express-generators-bin-www
|
|
/*
|
|
module.exports = (io) => {
|
|
var app = require('express');
|
|
var router = app.Router();
|
|
|
|
io.on('connection', function(socket) {
|
|
});
|
|
return router;
|
|
};
|
|
*/
|