Skip to content
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

fix(router): make router handler non preemtive by default #194

Merged
merged 4 commits into from Oct 15, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Oct 15, 2022

Resolves #183

Make router created by createRouter a middleware by default. Meaning it will lt the app continue searching for other matching middleware registered after if not route matches. (if route matches but not method, it will still throw an error).

BREAKING CHANGE: Router middleware will not stop with 404 if no matches are found. Using new createRouter({ preemptive: true }) previous behavior can be done to stop app middleware immediately.

@pi0 pi0 changed the title fix(router): allow app to match other routers fix(router): make router handler non preemtive by default Oct 15, 2022
@codecov
Copy link

codecov bot commented Oct 15, 2022

Codecov Report

Merging #194 (cf70868) into main (b986629) will decrease coverage by 0.27%.
The diff coverage is 72.22%.

@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
- Coverage   78.83%   78.55%   -0.28%     
==========================================
  Files          19       19              
  Lines        1044     1054      +10     
  Branches      208      208              
==========================================
+ Hits          823      828       +5     
- Misses        221      226       +5     
Impacted Files Coverage Δ
src/router.ts 94.79% <64.28%> (-5.21%) ⬇️
src/app.ts 93.75% <100.00%> (+0.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 merged commit cb3bafe into main Oct 15, 2022
@pi0 pi0 deleted the fix/nested-router branch October 15, 2022 12:06
@pi0 pi0 mentioned this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple routers do not work
1 participant