0.0.1 • Published 6 years ago

bee-health-check v0.0.1

Weekly downloads
30
License
MIT
Repository
-
Last release
6 years ago

Bee Health Check

Health check to express and restify projects

Install

npm install -S bee-health-check

Usage

const restify = require('restify');
const healthCheck = require('bee-health-check');

const app = restify.createServer();

const options = {
  healthFn = (req, res) => Promise.resolve({ ok: true }), // default
  successStatusCode = 200, // default
  failureStatusCode = 503 // default
}

app.get('/health-check', healthCheck(options));

options

NameTypeDescriptiondefault
healthFnPromise.<Object, Error>Promise based function to check api health, the response will be sent as application/json(req, res) => Promise.resolve({ ok: true })
successStatusCodenumberStatus code to be sent when healthFn fullfilled200
failureStatusCodenumberStatus code to be sent when healthFn rejected503