Skip to Content
Senri

Health checks

Answer /healthz and /readyz with health()

import { ,  } from "@senrijs/senri";
declare const : { (): boolean };

const  = ();

.(({ : () => .() }));
PathAnswer
/healthz200 if the app can answer (liveness)
/readyz200 if ready() returns true. 503 on false, on an exception, and after shutdown has started (readiness)
  • On SIGTERM, serve() first makes /readyz return 503, so that load balancers stop sending new requests (Graceful shutdown)
  • The paths can be changed. Set one to false to leave it out

Options

Prop

Type

On this page