aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/config/express.js
diff options
context:
space:
mode:
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