Skip to main content

Core REST API

The Core wire exposes a small set of utility endpoints for health checks and server information.

Endpoints

Health Check

GET /health

Returns the health status of the application and its dependencies.

curl http://localhost:3000/health

Response (200):

{
"status": "healthy",
"uptime": 3600,
"database": "connected",
"wires": {
"auth": "ready",
"messaging": "ready",
"store": "ready"
}
}

Response (503) -- unhealthy:

{
"status": "unhealthy",
"uptime": 3600,
"database": "disconnected",
"wires": {
"auth": "ready",
"messaging": "error"
}
}

Server Info

GET /info

Returns basic server information (only available when NODE_ENV is not production).

curl http://localhost:3000/info

Response (200):

{
"name": "my-app",
"version": "1.0.0",
"fluxkit": "0.1.0",
"node": "v20.10.0",
"wires": ["auth", "messaging", "store"],
"uptime": 3600
}

Ready Check

GET /ready

Returns whether the server is ready to accept requests. Useful for Kubernetes readiness probes.

curl http://localhost:3000/ready

Response (200):

{
"ready": true
}

Response (503):

{
"ready": false,
"reason": "Database connection pending"
}