1.3.0 • Published 5 years ago

@appliedblockchain/koa-healthcheck v1.3.0

Weekly downloads
511
License
ISC
Repository
-
Last release
5 years ago

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
1.3.0

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago