diff options
author | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-27 13:23:56 +0200 |
---|---|---|
committer | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-27 13:23:56 +0200 |
commit | a367363d725795c5f0fe83ef3417db2bd3bd3915 (patch) | |
tree | 2ea4a1f53c05b6f2030140eb2755fa0e6d4eec21 /config/express.js | |
parent | fixed small bug (diff) | |
download | Divid-a367363d725795c5f0fe83ef3417db2bd3bd3915.tar.gz |
cleaned up some and added a bunch of comments
Diffstat (limited to 'config/express.js')
-rw-r--r-- | config/express.js | 6 |
1 files changed, 4 insertions, 2 deletions
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 |