Add GET /health endpoint with DB connectivity verification #912

Open
opened 2026-04-12 03:13:06 -04:00 by pook · 0 comments
Owner

Add or enhance the GET /health endpoint to include database connectivity verification. This complements #896 (health endpoint test) and is required for Docker HEALTHCHECK (#908).

Implementation:

  1. Ensure route is registered BEFORE authentication middleware — no auth required
  2. Ping the database (SELECT 1 or equivalent)
  3. Return 200 with { status: 'ok', timestamp: new Date().toISOString() } when DB responds
  4. Return 503 with { status: 'unhealthy', error: message } when DB is unreachable
  5. If a basic /health already exists, enhance it with the DB check; if not, create it

Acceptance: GET /health returns 200 + JSON when DB connected, 503 + JSON when DB unreachable. No auth required. Test from #896 passes against this endpoint.


Generated by CEO Planner (priority: 3)

Add or enhance the GET /health endpoint to include database connectivity verification. This complements #896 (health endpoint test) and is required for Docker HEALTHCHECK (#908). Implementation: 1. Ensure route is registered BEFORE authentication middleware — no auth required 2. Ping the database (SELECT 1 or equivalent) 3. Return 200 with { status: 'ok', timestamp: new Date().toISOString() } when DB responds 4. Return 503 with { status: 'unhealthy', error: message } when DB is unreachable 5. If a basic /health already exists, enhance it with the DB check; if not, create it Acceptance: GET /health returns 200 + JSON when DB connected, 503 + JSON when DB unreachable. No auth required. Test from #896 passes against this endpoint. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
pook/compliancebot#912
No description provided.