Skip to content

Health Check

Check if the server is running and the database is reachable. No authentication required.

Terminal window
curl https://codecosts.com/api/health
FieldTypeDescription
statusstring"ok" when the server and database are healthy
dbLatencyMsnumberRound-trip time for a test query to the database (milliseconds)
{
"status": "ok",
"dbLatencyMs": 2
}

Returned when the server is running but the database is unreachable.

FieldTypeDescription
statusstring"degraded"
errorstring"Database unreachable"
dbLatencyMsnumberTime spent attempting the query before failure
{
"status": "degraded",
"error": "Database unreachable",
"dbLatencyMs": 5000
}