#Explaination: Why did rearranging the order of controller functions work
9 messages · Page 1 of 1 (latest)
This was the code before.\
When I refactored and moved the code up, I started to get the desired response. Please can someone explain why this happened?
Thanks
that's because the GET /:id will overwrite GET /search
because of the :id placeholder
this is mentioned somewhere in the docs
and so you must ensure that GET /search is declared before the GET /:id route
and the routes registration order is the same as the order of calling @Get(), etc, decorators
Oh that makes sense now. Thanks so much @latent schooner