api-health-hono
@rtorcato/api-health-hono provides ready-made Hono handlers for liveness and readiness probes, backed by an @rtorcato/api-health registry.
Install
pnpm add @rtorcato/api-health @rtorcato/api-health-hono
Usage
import { createHealthRegistry } from '@rtorcato/api-health'
import { livenessHandler, readinessHandler } from '@rtorcato/api-health-hono'
const health = createHealthRegistry()
health.register('db', async () => { await db.query('SELECT 1') })
app.get('/healthz', livenessHandler()) // always 200
app.get('/readyz', readinessHandler(health)) // 200 all-pass, 503 any-fail
livenessHandler()— always responds200 { status: 'healthy' }; runs no checks.readinessHandler(registry)— runs the registry's checks and responds200when all pass or503when any fail, with the full report as the body.
See the api-health guide for registering checks and the liveness-vs-readiness rationale.