@starefossen/express-health

1.0.1 • Public • Published

@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

Package Sidebar

Install

npm i @starefossen/express-health

Weekly Downloads

9

Version

1.0.1

License

MIT

Last publish

Collaborators

  • starefossen