-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add exclusive
option
#129
Conversation
Why this is not merged? |
because maintainers weren't notified :) |
@@ -31,6 +31,7 @@ Create a new router. | |||
| --- | --- | --- | | |||
| [opts] | <code>Object</code> | | | |||
| [opts.prefix] | <code>String</code> | prefix router paths | | |||
| [opts.exclusive] | <code>Boolean</code> | only run last matched route's controller when there are multiple matches | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add some examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to add examples in another PR that'd be cool! If not no worries.
We have just published https://github.com/koajs/router/releases/tag/v11.0.0 This project is maintained by Forward Email and Lad. |
closes #95
This PR introduces an
exclusive
boolean option, that makes the router only execute the most specific layer (last match if i understand correctly) when there are multiple route matches for a request url.c.f.
router/lib/router.js
Line 356 in 90dd73c
It is
false
by default, so as not introduce a breaking change.