aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/config/express.js
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-27 13:23:56 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-27 13:23:56 +0200
commita367363d725795c5f0fe83ef3417db2bd3bd3915 (patch)
tree2ea4a1f53c05b6f2030140eb2755fa0e6d4eec21 /config/express.js
parentfixed small bug (diff)
downloadDivid-a367363d725795c5f0fe83ef3417db2bd3bd3915.tar.gz
cleaned up some and added a bunch of comments
Diffstat (limited to 'config/express.js')
-rw-r--r--config/express.js6
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