Match both `/` and `/:id` routes the the same router
Hello, is there any way to handle 2 routes in the same router? We want to handle requests coming to both
/
and /:id
to handle when id is undefined or has a value.3 Replies
You can place a
?
mark like this /:id?
this will make it either string
or undefined
Didn't know about that! Let me try, any more documentation on the url syntax? Is this regex based?
that did it! THank you so much!
Yup
Can you mark this as resolved?