-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
docs: clarify route middleware doesn't affect API routes #33643
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
Conversation
|
|
WalkthroughAn additional important block was inserted into the routing documentation after the existing Route Middleware note. The new block explicitly states that route middleware does not run for server routes (for example, Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches✅ Passed checks (4 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 |
Co-authored-by: Matej Černý <[email protected]>
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/1.getting-started/07.routing.md (1)
93-95: Remove trailing period before closing marker for consistency.The content effectively clarifies the scope of route middleware and aligns well with the PR objectives. However, the period before the closing
::is unusual for Markdown callout block formatting.Apply this diff to align with typical documentation conventions:
::important -Route middleware does **not** run for server routes (e.g. `/api/*`) or other server requests. To apply middleware to these requests, use [server middleware](/docs/4.x/guide/directory-structure/server#server-middleware) instead. +Route middleware does **not** run for server routes (e.g. `/api/*`) or other server requests. To apply middleware to these requests, use [server middleware](/docs/4.x/guide/directory-structure/server#server-middleware) instead ::The content itself directly addresses the confusion identified in issue #33642 and provides clear guidance on using server middleware for API route interception.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/1.getting-started/07.routing.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/1.getting-started/07.routing.md
[uncategorized] ~94-~94: Loose punctuation mark.
Context: ...ture/server#server-middleware) instead. :: There are three kinds of route middle...
(UNLIKELY_OPENING_PUNCTUATION)
Fixes #33642
Route middleware only runs during page navigation (Vue Router), not for API routes. Added callout to clarify this.
Implementation:
packages/nuxt/src/pages/runtime/plugins/router.ts:182-260(Vue RouterbeforeEach)defineEventHandler(separate runtime for now 😉)