Skip to content

Add simple healthcheck endpoint#81

Merged
chrisvire merged 2 commits intodevelopfrom
fix/health-endpoint
Apr 15, 2026
Merged

Add simple healthcheck endpoint#81
chrisvire merged 2 commits intodevelopfrom
fix/health-endpoint

Conversation

@FyreByrd
Copy link
Copy Markdown
Contributor

@FyreByrd FyreByrd commented Apr 15, 2026

Summary by CodeRabbit

  • New Features
    • Added a health check endpoint that bypasses authentication requirements, allowing external services to verify API availability without credentials.

@FyreByrd FyreByrd requested a review from chrisvire April 15, 2026 19:52
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Warning

Rate limit exceeded

@FyreByrd has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 31 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 53 minutes and 31 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4135f0d-956e-4668-8d5c-f84a9bc478ae

📥 Commits

Reviewing files that changed from the base of the PR and between 428ab82 and 1f77675.

📒 Files selected for processing (1)
  • src/hooks.server.ts
📝 Walkthrough

Walkthrough

A new health check endpoint is added to the SvelteKit API routes, with corresponding bypass logic in the server hooks to skip token verification when the health endpoint is accessed. The endpoint returns a 200 status with no body content.

Changes

Cohort / File(s) Summary
Health Check Endpoint
src/hooks.server.ts, src/routes/(api)/health/+server.ts
Added early-return bypass in handleAPIRoute to skip token verification for health check routes; implemented new GET handler at /health returning 200 status with null body.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A health check hops through without delay,
No tokens to verify on this endpoint's way,
Status 200, the message is clear—
The server's alive and the route's right here! 💚

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a health check endpoint. It directly reflects the core functionality of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/health-endpoint

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/hooks.server.ts`:
- Line 13: The guard in the hook currently bypasses auth for any route whose
third path segment equals 'health' using event.route.id?.split('/')[2]; change
it to match the exact route id for the health endpoint instead (e.g.,
event.route.id === '/(api)/health' or whatever the exact route id is in your
app) so only that single route returns resolve(event) without token
verification; update the check in the hook where event.route.id and
resolve(event) are used to use strict equality against the precise health route
id.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 069267d3-3ff0-49fc-9430-de4f09b33212

📥 Commits

Reviewing files that changed from the base of the PR and between 817c6e5 and 428ab82.

📒 Files selected for processing (2)
  • src/hooks.server.ts
  • src/routes/(api)/health/+server.ts

Comment thread src/hooks.server.ts Outdated
Copy link
Copy Markdown
Member

@chrisvire chrisvire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chrisvire chrisvire merged commit 02d6dd3 into develop Apr 15, 2026
4 checks passed
@FyreByrd FyreByrd deleted the fix/health-endpoint branch April 15, 2026 20:52
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