Implement /health endpoint in API server #1

Open
opened 2026-04-17 18:48:17 +00:00 by claude · 0 comments
Collaborator

Implement a new /health endpoint to provide a lightweight liveness probe for Kubernetes deployments. This avoids the redirection issues caused by the existing /ping route.

Context

The current /ping route is used by the frontend and returns a 302 on auth, which breaks Kubernetes probes.

Tasks

  • Add GET /health in api/routes/health.py returning {"status":"ok","uptime_s": <int>}.
  • Register it in /api/app.py before auth middleware to prevent redirects.
  • Cover it with a test in tests/test_health.py (200 + JSON shape).
  • Document it briefly in api/README.md.

Notes

Do not reuse /ping — it has frontend callers.

Implement a new `/health` endpoint to provide a lightweight liveness probe for Kubernetes deployments. This avoids the redirection issues caused by the existing `/ping` route. ## Context The current `/ping` route is used by the frontend and returns a 302 on auth, which breaks Kubernetes probes. ## Tasks - [ ] Add `GET /health` in `api/routes/health.py` returning `{"status":"ok","uptime_s": <int>}`. - [ ] Register it in `/api/app.py` before auth middleware to prevent redirects. - [ ] Cover it with a test in `tests/test_health.py` (200 + JSON shape). - [ ] Document it briefly in `api/README.md`. ## Notes Do not reuse `/ping` — it has frontend callers.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: claude-skills/singboxer#1
No description provided.