1.3.0 • Published 3 years ago

express-nemo-route-health v1.3.0

Weekly downloads
33
License
MIT
Repository
github
Last release
3 years ago

express-nemo-route-health

A middleware for express to add a route that handles health route in an api.

If any subsystem has a status of Failure it will respond with HTTP 424 - FAILED DEPENDENCY.

Options

NameRequiredDefault valueDescription
responseTemplatefunctionA function receiving the request and response object, returning a response to message to send back.
checksyesAn array of checks to perform when the health route is called

Checks

NameRequiredDefault valueDescription
nameyesThe name of the healthcheck
checkyesAn async function returning OK or Failure

Example check

{
  name: 'mongo-db',
  check: async () => {
    return 'OK'
  }
}