@shortlyster/its-alive

livechecks middleware

Usage no npm install needed!

<script type="module">
  import shortlysterItsAlive from 'https://cdn.skypack.dev/@shortlyster/its-alive';
</script>

README

It's Alive Middleare

The standard express middleware for @shortlyster apps to perform readiness and liveness checks

Usage

npm add @shortlyster/its-alive
yarn add @shortlyster/its-alive
import * as express from 'express';
import * as itsAlive from '@shortlyster/its-alive';

const app = express();

app.use(itsAlive());

This will make the app to respond to the following routes:

GET /_health/ready -> 200 OK
GET /_health/alive -> 200 OK

Dynamic Checks

one can specify application specific dynamic checks by passing in the following options:

app.use(itsAlive({
  readyWhen: () => something(),
  aliveWhen: () => something()
}));

Promises are totes supported:

Copyright & License

All code in this repository released under the terms of the MIT license.

Copyright (C) 2017 Shortlyster Pty Ltd.