Health Check
Check if the server is running and the database is reachable. No authentication required.
Request
Section titled “Request”curl https://codecosts.com/api/healthResponse
Section titled “Response”200 — Healthy
Section titled “200 — Healthy”| Field | Type | Description |
|---|---|---|
status | string | "ok" when the server and database are healthy |
dbLatencyMs | number | Round-trip time for a test query to the database (milliseconds) |
{ "status": "ok", "dbLatencyMs": 2}503 — Degraded
Section titled “503 — Degraded”Returned when the server is running but the database is unreachable.
| Field | Type | Description |
|---|---|---|
status | string | "degraded" |
error | string | "Database unreachable" |
dbLatencyMs | number | Time spent attempting the query before failure |
{ "status": "degraded", "error": "Database unreachable", "dbLatencyMs": 5000}