Edit Page

req.params

An object containing parameter values parsed from the URL path.

For example if you have the route /user/:name, then the "name" from the URL path wil be available as req.params.name. This object defaults to {}.

Usage

#
req.params;

Notes

#
  • When a route address is defined using a regular expression, each capture group match from the regex is available as req.params[0], req.params[1], etc. This strategy is also applied to unnamed wild-card matches in string routes such as /file/*.

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