Skip to content

refactor: collapse pages API into single handler with query slug#36

Merged
rsbh merged 2 commits intomainfrom
chore_pages_handler
Apr 15, 2026
Merged

refactor: collapse pages API into single handler with query slug#36
rsbh merged 2 commits intomainfrom
chore_pages_handler

Conversation

@rsbh
Copy link
Copy Markdown
Member

@rsbh rsbh commented Apr 15, 2026

Summary

  • Replace catch-all /api/page/[...slug] with single /api/page handler
  • Slug now passed as comma-separated query param: ?slug=cli,commands
  • Empty/missing slug returns root page

Test plan

  • GET /api/page returns root page (200)
  • GET /api/page?slug=cli returns CLI page frontmatter (200)
  • GET /api/page?slug=nonexistent returns 404
  • Client navigation still loads pages correctly

🤖 Generated with Claude Code

rsbh and others added 2 commits April 15, 2026 16:01
Move /api/page/[...slug] to /api/page, accepting comma-separated
slug via ?slug= query param. Empty/missing returns root page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Warning

Rate limit exceeded

@rsbh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 3 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 3 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88f55c5e-806a-4732-9c78-525d7462b3ab

📥 Commits

Reviewing files that changed from the base of the PR and between 752b303 and bf0f0f9.

📒 Files selected for processing (3)
  • packages/chronicle/src/lib/page-context.tsx
  • packages/chronicle/src/server/api/page.ts
  • packages/chronicle/src/server/api/page/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore_pages_handler

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rsbh rsbh merged commit d7f2a87 into main Apr 15, 2026
1 check passed
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.

2 participants