Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jomoflash/ab3c643769936390ad6133f600284244 to your computer and use it in GitHub Desktop.

Select an option

Save jomoflash/ab3c643769936390ad6133f600284244 to your computer and use it in GitHub Desktop.
ExpressJS Series: Difference the req.baseUrl req.originalUrl req.path
app.use('/admin', function(req, res, next) {
/* GET 'http://www.example.com/admin/new' */
console.log(req.originalUrl); // '/admin/new'
console.log(req.baseUrl); // '/admin'
console.log(req.path); // '/new'
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment