Express Health Check Middleware
Add health, readiness, liveness and metrics functionality to express.
Add Health Endpoint
Only checks whether the application server is running It does not verify the database or other services are running. A successful response will return a 200 status code
Add Readiness Endpoint
Sometimes, applications are temporarily unable to serve traffic. For example, an application might need to load large data or configuration files during startup, or depend on external services after startup. In such cases, you don’t want to kill the application, but you don’t want to send it requests either.
Add Liveness Endpoint
Many applications running for long periods of time eventually transition to broken states, and cannot recover except by being restarted.
Add Metrics Endpoint
- Node process metrics
- Infrastructure to collect internal metrics (like southbound APIs)
- API to retrieve the collected metrics and to reset them.
How to use
npm install --save @ozawa/express-health-check-middleware
const express = ;const healthCheckMiddleware = ;const mongoose = ;const app = ;app;app;const main = asynclet mongooseOptions = useNewUrlParser: truelet databaseUrl = processenvDATABASE_URL || 'mongodb://localhost:27017/my-app'await mongooseapp;;