@appliedblockchain/koa-healthcheck

1.3.0 • Public • Published

Koa Healthcheck Middleware

Installation:

npm -i @appliedblockchain/koa-healthcheck

and in your application:

const healthcheck = require('@appliedblockchain/koa-healthcheck');

The default will use the path /health:

app.use(healthcheck())

With a custom path:

app.use(healthcheck({ path: '/custompath' }))

With a custom report object (appended):

app.use(healthcheck({ custom: {
  foo: 'bar',
  bin: () => 'baz'
} }))

Healthcheck Token:

If healthcheck token is not provided, healthcheck would not show detail information about server.

const HEALTH_TOKEN = 'example-token-1234567890'

app.use(healthcheck({ custom: {
  foo: 'bar',
  bin: () => 'baz'
}}, HEALTH_TOKEN ))

Provides detail information about server:

curl -X GET  -H "health-token:example-token-1234567890" localhost:3000/health

Provides minimal/custom information only:

curl -X GET localhost:3000/health

Readme

Keywords

none

Package Sidebar

Install

npm i @appliedblockchain/koa-healthcheck

Weekly Downloads

82

Version

1.3.0

License

ISC

Unpacked Size

8.58 kB

Total Files

6

Last publish

Collaborators

  • mirek
  • remundro
  • justjarethb
  • ilogico
  • ewan-sims-applied-blockchain
  • lanreayobamidele
  • andyharr15
  • aditya.gupta.appliedblockchain
  • geoffreychalk
  • brunoneves-devops
  • samfcmc
  • tiagorvmartins
  • kjack83
  • losceicco
  • ruisereno
  • telmof
  • andremfaria
  • lbltavaresab
  • ztadic91
  • pedrolino
  • alisson-diniz-ab
  • juniorerico
  • diogopalhais
  • gabspeck
  • ab-ci
  • andycampbell92
  • danchmelo
  • seromenho
  • kennypt
  • zeluisping
  • pmcleite-ab
  • filipepedro
  • mnikolaus
  • bertola
  • lpalmeida
  • lslima91