node-healthz
v2.0.2
Published
The "health-checkup" npm package simplifies the process of implementing health checks in Node.js applications, allowing you to ensure the reliability and availability of your system components effortlessly.
Downloads
2,348
Maintainers
Readme
node-healthz
The "health-checkup" npm package simplifies the process of implementing health checks in Node.js applications, allowing you to ensure the reliability and availability of your system components effortlessly.
import { check } from 'node-healthz'
check({
checks: [
{
id: 'PostgreSQL',
required: true,
fn: async () => /* ... */,
},
{
id: 'Redis',
fn: async () => /* ... */,
},
],
})
curl http://localhost:46461/healthz --verbose | jq
< HTTP/1.1 200 OK
{
"status": "OK",
"checks": [
{
"id": "PostgreSQL",
"required": "true",
"t": "1,003ms",
"output": "<masked>"
},
{
"id": "Redis",
"required": "false",
"t": "11ms",
"output": "<masked>"
}
]
}