Health checks
Answer /healthz and /readyz with health()
import { , } from "@senrijs/senri";
declare const : { (): boolean };
const = ();
.(({ : () => .() }));| Path | Answer |
|---|---|
/healthz | 200 if the app can answer (liveness) |
/readyz | 200 if ready() returns true. 503 on false, on an exception, and after shutdown has started (readiness) |
- On SIGTERM,
serve()first makes/readyzreturn 503, so that load balancers stop sending new requests (Graceful shutdown) - The paths can be changed. Set one to
falseto leave it out
Options
Prop
Type