From the Express.js documentation:
req.urlis not a native Express property, it is inherited from
Node’shttp
module.This property is much like
req.url; however, it retains the original
request URL, allowing you to rewritereq.urlfreely for internal
routing purposes. For example, the “mounting” feature ofapp.use()
will rewritereq.urlto strip the mount point.
In other words, req.url might be overwritten during the internal routing, while req.originalUrl will remain untouched.