Created
October 4, 2018 03:03
-
-
Save ganeshkbhat/6024a3e1eebf9aa3449aba90e0a4a215 to your computer and use it in GitHub Desktop.
ExpressJS Series: Difference the req.baseUrl req.originalUrl req.path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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