req.originalUrl
req.url
is not a native Express property, it is inherited from Node’s http module.
This property is much like req.url
; however, it retains the original request URL, allowing you to rewrite req.url
freely for internal routing purposes. For example, the “mounting” feature of app.use() will rewrite req.url
to strip the mount point.
// GET /search?q=something req.originalUrl // => "/search?q=something"
Please login to continue.