feat: Support typed params in routes
Open
5.x
discuss
enhancement
module:router
- Dominant language
- JavaScript
- Stars
- 69.5k
- Forks
- 25k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
I mean, do something like:
``` js
app.route('/:an_id{number}');
app.route('/:another_id{string}')
```
which is roughly equivalent to use regex in each case, but the shorthand above is clearer and allows `req.params` to properly type the params, fi: `req.params.an_id` would be a number instead of a string.
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.