[fix] Match the right controller when multiple routes matches without calling next() #168
Open
3 tasks done
Labels
bug
Something isn't working
Describe the bug
Node.js version:
Node v16.15.1
OS version:
MacOs Ventura Version 13.3.1 (a)
Description:
When multiple routes match, the router doesn't seems to execute the right controller without calling
next()
.Actual behavior
When not calling
next()
it execute the first controller and don't pass through the second, when next() is called both controllers are executedExpected behavior
Without calling
next()
it should match the right route controller and execute itEdit i've looked at the source code to see how it works under the hood i've seen the
exclusive
options that i have tested before on my use case but did not fit well with other of my controllers (that's an another story) but i have one question why execute themostSpecificLayer
should be an option ?As stated in the documentation here if we want to execute multiple middleware we just have to chain them in the route definition
Code to reproduce
Here a test i've written (for now i've found a workaround by calling my route
users/count
before the routeusers/:id
)Checklist
The text was updated successfully, but these errors were encountered: