@json-express/plugin-health
Official health check plugin for JSONExpress.
The @json-express/plugin-health package is a tiny but critical enterprise utility. It automatically mounts strict HTTP endpoints that container orchestrators (like Kubernetes) or Cloud Load Balancers (like AWS ALB) use to determine if your application is alive and ready to receive traffic.
Installation
npm install @json-express/plugin-healthConfiguration
The plugin is auto-discovered by the json-express runtime — installing the package is enough.
npm install @json-express/plugin-health
npx json-expressBy default it exposes two endpoints:
GET /health— livenessGET /ready— readiness
To match your infrastructure conventions, override the paths in .env:
jex.health.livenessPath=/internal/liveness
jex.health.readinessPath=/internal/readinessCore Features
Liveness vs Readiness
It is an industry standard to separate health checks into two distinct probes.
- Liveness Probe (
/health): This endpoint simply returns a200 OKthe moment the Node.js event loop is running. If this endpoint times out or returns a 500, Kubernetes will aggressively kill the Pod and restart it. - Readiness Probe (
/ready): This endpoint actively pings the underlyingIDatabaseAdapterand checks the connection to the Key-Value store. If the database is unreachable, this endpoint returns a503 Service Unavailable. Kubernetes will not kill the Pod, but it will instantly remove it from the Load Balancer so no user traffic is routed to it until the database connection recovers.
Zero-Overhead Logging
Health probes are typically pinged by Load Balancers every 5 to 10 seconds. If left unchecked, this will completely flood your application access logs and increase your Datadog/CloudWatch billing.
The JSONExpress transport layer automatically detects paths mounted by the Health plugin and silences their access logs. You get perfect infrastructure monitoring without the log spam.
Related Ecosystem Packages
- @json-express/core: The core engine that orchestrates the boot sequence before marking the
/readyprobe as active.