docs: clarify route-scoped middleware example path#4445
Open
BTF-Kabir-2020 wants to merge 1 commit into
Open
Conversation
|
@BTF-Kabir-2020 is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
📝 WalkthroughWalkthroughThe routing documentation now uses a non- ChangesMiddleware documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
Use a non-middleware handler path in the handlers examples and note that middleware auto-scan only applies when serverDir is set. Fixes nitrojs#4354
BTF-Kabir-2020
force-pushed
the
docs/clarify-route-scoped-middleware-path
branch
from
July 17, 2026 18:09
ef88973 to
6840a50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update the route-scoped middleware
handlersexamples to use./server/utils/api-auth.tsinstead of./server/middleware/api-auth.ts, and clarify thatmiddleware/auto-registration only happens whenserverDiris set.Fixes #4354
Why this approach
@pi0 noted on the issue / prior PRs that auto-scanning is opt-in via
serverDir, so earlier wording that treatedmiddleware/as always-global was inaccurate.This PR:
middleware/to avoid reader confusionserverDirwhere auto-registration is describedmiddleware/whenserverDiris enabledNotes
docs/1.docs/5.routing.md