diff --git a/package.json b/package.json index a5b65dd..ae20e12 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,12 @@ "author": "Bram van der Veen", "license": "ISC", "dependencies": { + "body-parser": "^1.13.1", "cheerio": "^0.19.0", "express": "^4.12.4", "express-less": "0.0.7", "jade": "^1.11.0", "mongodb": "^1.4.38", - "mongoskin": "^1.4.13" + "mongoskin": "^1.4.13", } } diff --git a/web.js b/web.js index c0501d1..874bf8f 100644 --- a/web.js +++ b/web.js @@ -1,12 +1,14 @@ //web.js -var config = require('./configuration'); var express = require('express'); var less = require('express-less'); -var app = express(); +var body_parser = require('body-parser'); +var config = require('./configuration'); var lookup = require('./lookup'); var schedule = require('./schedule'); +var app = express(); + //Set up jade rendering engine. app.set('view engine', 'jade'); config().env == 'dev' ? app.disable('view cache') : null; //If the environment is set on 'dev' then view cache should be disabled. @@ -18,26 +20,26 @@ app.use('/js', express.static(__dirname + '/resources/js')); app.use('/other', express.static(__dirname + '/resources/other')); app.get('/', function (req, res) { - req.links = config().links; - res.render('homepage', req); + req.links = config().links; + console.log(req.user); + res.render('homepage', req); }); app.get('/rooster/:search', function (req, res) { - next(); + next(); }); - app.get('/over', function (req, res) { - res.send('Hier kun je lezen over werkmanrooster.'); + res.send('Hier kun je lezen over werkmanrooster.'); }); app.param('search', lookup); app.param('search', schedule); app.param('search', function (req, res) { - req.links = config().links; - req.times = config().hour_times; - res.render('schedule', req); + req.links = config().links; + req.times = config().hour_times; + res.render('schedule', req); }); app.listen(config().web_port);