@hmcts/nodejs-healthcheck
Healthcheck endpoint for Reform nodejs applications
Last updated 6 months ago by jenkins-reform-hmcts .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @hmcts/nodejs-healthcheck 
SYNC missed versions from official npm registry.

Nodejs Healthcheck

Greenkeeper badge

A library for adding reform standard compliant healthchecks to nodejs applications.

Usage

Configure an express.js handler with checks.

const healthcheck = require('@hmcts/nodejs-healthcheck');

app.get("/status", healthcheck.configure({
  checks: {
    mySimpleWebCheck: healthcheck.web("https://example.com/status"),
    myComplexWebCheck: healthcheck.web("https://example.com/other", {
      callback: (err, res) => {
        return res.body.status == "good" ? healthcheck.up() : healthcheck.down()
      },
      timeout: 5000,
      deadline: 10000,
    }),
    myRawCheck: healthcheck.raw(() => {
      return myInternalCheck() ? healthcheck.up() : healthcheck.down()
    })
  },
  buildInfo: {
    myCustomBuildInfo: "yay"
  }
}));

Publishing

Bump the version (SemVer) and create a release in the GitHub UI, Travis CI will then build test and release to the npm registry.

To Test

Run yarn install (if packages not downloaded) and then run yarn test to run unit tests

Current Tags

  • 1.5.1                                ...           latest (6 months ago)

9 Versions

  • 1.5.1                                ...           6 months ago
  • 1.4.6                                ...           2 years ago
  • 1.4.5                                ...           2 years ago
  • 1.4.4                                ...           2 years ago
  • 1.4.3                                ...           2 years ago
  • 1.4.2                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
Downloads
Today 0
This Week 1
This Month 10
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (9)

Copyright 2014 - 2016 © taobao.org |