From a367363d725795c5f0fe83ef3417db2bd3bd3915 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Mon, 27 May 2013 13:23:56 +0200 Subject: cleaned up some and added a bunch of comments --- config/express.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config/express.js') diff --git a/config/express.js b/config/express.js index a281123..d9d4633 100644 --- a/config/express.js +++ b/config/express.js @@ -33,8 +33,8 @@ module.exports = function (app, config, passport) { app.use(express.session({ secret: config.sessionSecret })); // use passport session - app.use(passport.initialize()); - app.use(passport.session()); + app.use(passport.initialize()); // initializes passport, our login module + app.use(passport.session()); // With sessions! app.use(express.favicon(__dirname + '/public/favicon.ico')); @@ -43,6 +43,8 @@ module.exports = function (app, config, passport) { app.use(app.router); + // If no routes are triggered, we reach these babies: + app.use(function(err, req, res, next) { if (~err.message.indexOf('not found')) return next(); // treat like 404 -- cgit v1.2.3