@starefossen/express-health
Health checking route for Express.js applications.
Install
$ npm install @starefossen/express-health --save
Usage
const healthCheck = require('@starefossen/express-health');
### Single Check
```js
app.get('/healthCheck', healthCheck({
name: 'Database',
check: cb => {
// get status from database
db.getStatus(cb);
},
}));
Multiple Checks
app.get('/healthChecks', healthCheck([{
name: 'MongoDB',
check: cb => {
// get status from MongoDB database
mongo.db.stats(cb);
},
},{
name: 'Redis',
check: cb => {
// get status from Redis cache
redis.info(cb);
},
}]));