Add production health checks
This commit is contained in:
+35
-2
@@ -319,14 +319,47 @@ Validation failures return `400` with this shape:
|
||||
|
||||
#### `GET /api/health`
|
||||
|
||||
Public health check.
|
||||
Public readiness-compatible health check. Verifies backend dependencies.
|
||||
|
||||
Response `200`:
|
||||
|
||||
```json
|
||||
{ "ok": true }
|
||||
{
|
||||
"ok": true,
|
||||
"service": "flockpal-backend",
|
||||
"status": "ready",
|
||||
"checkedAt": "2026-06-06T00:00:00.000Z",
|
||||
"dependencies": {
|
||||
"postgres": { "ok": true, "latencyMs": 3 },
|
||||
"redis": { "ok": true, "latencyMs": 4 }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Response `503` when Postgres or Redis is unavailable.
|
||||
|
||||
#### `GET /api/health/live`
|
||||
|
||||
Public liveness check. Verifies the backend process is running without checking dependencies.
|
||||
|
||||
Response `200`:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"service": "flockpal-backend",
|
||||
"status": "live",
|
||||
"uptimeSeconds": 120,
|
||||
"checkedAt": "2026-06-06T00:00:00.000Z"
|
||||
}
|
||||
```
|
||||
|
||||
#### `GET /api/health/ready`
|
||||
|
||||
Public readiness check. Verifies the backend can reach Postgres and Redis.
|
||||
|
||||
Response `200` uses the same shape as `GET /api/health`; response `503` means at least one dependency failed.
|
||||
|
||||
### Metrics
|
||||
|
||||
#### `GET /api/metrics`
|
||||
|
||||
Reference in New Issue
Block a user