Skip to main content

Server health

GET /health
Auth: Public (rate limited) Quick liveness check — use this for load balancer health probes or uptime monitoring.

Response

{
  "status": "ok",
  "timestamp": "2024-03-15T10:30:00.000Z",
  "service": "openinary-api"
}
Status codes: 200 healthy

Example

curl http://localhost:3000/health

Database health

GET /health/database
Auth: API Key required Detailed diagnostic — checks the SQLite database connection, file permissions, and table record counts.

Response

{
  "status": "ok",
  "timestamp": "2024-03-15T10:30:00.000Z",
  "database": {
    "connected": true,
    "path": "/app/data/openinary.db",
    "size": "2.4 MB",
    "permissions": "0644",
    "tables": {
      "user": 1,
      "session": 3,
      "account": 1,
      "verification": 0,
      "apiKey": 2
    }
  }
}
database.connected
boolean
Whether the database connection is active.
database.path
string
Absolute path to the database file.
database.size
string
Database file size.
database.permissions
string
Octal file permissions.
database.tables
object
Record counts per table. Useful for verifying migrations applied correctly.
database.warning
string
Optional warning (e.g. unusual permissions).
Status codes: 200 healthy · 503 database connection failed

Example

curl http://localhost:3000/health/database \
  -H "Authorization: Bearer <api_key>"