fix: move API markdown route to utils to prevent SSR interception#79
Conversation
The catch-all `apis/[...slug].md.ts` route intercepted all `/apis/**` requests. For non-`.md` paths it returned undefined, which Nitro treated as empty 200, blocking SSR. Moved to a util function called from the root `[...slug].md.ts` handler instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR refactors API markdown handling from a Nitro request handler into a standalone function. The route handler now imports and delegates ChangesAPI Markdown Handler Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
Summary
apis/[...slug].md.tscatch-all intercepted all/apis/**requests, returning empty 200 for non-.mdpaths, blocking SSRserver/utils/api-markdown.tsas an exported function[...slug].md.tsnow callshandleApiMarkdown()for/apis/paths instead of skipping themTest plan
/apis/petstore/findPetsByStatusreturns full SSR HTML (was empty 200)/apis/petstore/findPetsByStatus.mdstill returns markdown/docs/getting-startedSSR unaffected/docs/getting-started.mdmarkdown unaffected🤖 Generated with Claude Code