I have an express API with a bunch of routes.
routes.get('/', perms('read', 'document'), r(CRUD.getAll))
routes.get('/search', perms('read', 'document'), r(CRUD.search))
routes.get('/:id', perms('read', 'document'), r(CRUD.getById))
I made sure to have /search
above /:id
, however, when a new request comes in to /search
, I see both endpoints getting a hit (I added a console.log
inside of each function).
I tried flipping the two and in that case, only /:id
gets a hit.
Any idea of why this may be happening?