I have two routes /api/persons/:personId
and /api/persons/contact
,where :personId
is an ObjectId.
When i am hitting api/persons/contactS
(with an 'S' character),it is hitting the API code for api/persons/:personId
instead of giving 404.
So how can i distinguish between the two routes.I want to restrict my code control upfront where i define my routes before giving the handle to controller.