Edit Page

req.originalUrl

From the Express docs:

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.

In almost all cases, you’ll want to use req.url instead. In the rare cases where req.url is modified (for example, inside of a policy or middleware in order to redirect to an internal route), req.originalUrl will give you the URL that was originally requested.

req.originalUrl;

// => "/search"

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.

Reference

Reference