Skip to content

Instantly share code, notes, and snippets.

@sahat
Created June 8, 2014 20:33
Show Gist options
  • Save sahat/661557ac8faecfb00ff7 to your computer and use it in GitHub Desktop.
Save sahat/661557ac8faecfb00ff7 to your computer and use it in GitHub Desktop.
using if statements
app.use(function(req, res, next) {
if (req.path !== '/auth' &&
req.path !== '/login' &&
req.path !== '/logout' &&
req.path !== '/signup' &&
req.path !== '/img' &&
req.path !== '/fonts' &&
req.path !== '/favicon') {
req.session.returnTo = req.path;
next();
}
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment