1.0.1 • Published 8 years ago

@starefossen/express-health v1.0.1

Weekly downloads
10
License
MIT
Repository
github
Last release
8 years ago

@starefossen/express-health

Build status Codacy grade Codacy coverage NPM downloads NPM version Node version Dependency status

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);
  },
}]));

MIT Licensed