Assuming you have a numeric identifier followed by iand you want the identifier to be returned as numeric only.
app.get("/:id([0-9]+)i", function (req, res) {...});
This will match the number that follows i, and you will only get a numeric value in req.params.id.
Example:
curl -XGET localhost:8080/124i
Gives me the following in req.params
[ 'id': 124 ]
source
share