Skip to content

Instantly share code, notes, and snippets.

@Sinetheta
Created March 4, 2013 01:14
Show Gist options
  • Save Sinetheta/5079257 to your computer and use it in GitHub Desktop.
Save Sinetheta/5079257 to your computer and use it in GitHub Desktop.
NodeJS connect middleware for removing trailing slashes http://stackoverflow.com/a/13443359/848249
app.use(function(req, res, next) {
if(req.url.substr(-1) == '/' && req.url.length > 1)
req.url.slice(0, -1);
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment