Folks, I need your expert advice: I have two endpoints on my node server using express:
'/api/status/:id'
'/api/status/all'
Now both have different purpose. One returns one status by Id and other one is all statuses. But express seems to be taking both request as the first one hence it is breaking on cast error. any help please.
You can define '/api/status/all' before '/api/status/:id' and if request will match to all it will be handled with that middleware.