From fa917a1a15f1271fcf854835de8a967d53869867 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Tue, 11 Mar 2014 14:15:04 -0400 Subject: [PATCH] Added a comment explanation on returnTo previous URL middleware, changed static cache from 1 week to 1 month --- app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 07b895505e..596278efcc 100755 --- a/app.js +++ b/app.js @@ -11,8 +11,6 @@ var passport = require('passport'); var expressValidator = require('express-validator'); var connectAssets = require('connect-assets'); - - /** * Load controllers. */ @@ -50,7 +48,6 @@ mongoose.connection.on('error', function() { var hour = 3600000; var day = (hour * 24); -var week = (day * 7); var month = (day * 30); app.set('port', process.env.PORT || 3000); @@ -85,8 +82,9 @@ app.use(function(req, res, next) { next(); }); app.use(flash()); -app.use(express.static(path.join(__dirname, 'public'), { maxAge: week })); +app.use(express.static(path.join(__dirname, 'public'), { maxAge: month })); app.use(function(req, res, next) { + // Keep track of previous URL if (req.method !== 'GET') return next(); var path = req.path.split('/')[1]; if (/(auth|login|logout|signup)$/.test(path)) return next();