Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hmcts/nodejs-healthcheck

Package Overview
Dependencies
Maintainers
14
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hmcts/nodejs-healthcheck

Healthcheck endpoint for Reform nodejs applications

  • 1.4.5
  • npm
  • Socket score

Version published
Weekly downloads
5.5K
decreased by-6.59%
Maintainers
14
Weekly downloads
 
Created
Source

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

To package and publish use the Makefile target. This requires your artifactory API key to be set to an environment variable called JFROG_API_KEY. You can get your key from your artifactory profile.

JFROG_API_KEY=fake-key make publish

To Test

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

FAQs

Package last updated on 01 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc