Hi i have been reading the express js docs and i got this sentence but i dont understand what dose this means this sentense is :
When you use a regular expression for the route definition, capture groups are provided in the array using req.params[n]
please can you give me an example that clarifay this sentense for me
the link in docs is : https://expressjs.com/en/4x/api.html#req.params
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
Let’s say that you have the following route:
/file/*, this means that anything after the
/file/will match the
So if you receive a GET request to
And the output in this case will be:
Hope that this helps!