@martini97/healthcheck-middleware

0.0.2 • Public • Published

healthcheck-middleware

Build Status
Simple module to check the health status of a service dependencies

Usage

Parameters

  • services: an object mapping the service name to its URL, the service must have a /_ping route.
const express = require('express');
const healthcheck = require('@martini97/healthcheck-middleware').default;

const servicesAllUp = {
  'service-1': 'http://service-1',
  'service-2': 'http://service-2',
  'service-3': 'http://service-3',
  'service-4': 'http://service-4',
};

async function application() {
  const app = express();
  app.use(await healthcheck(servicesAllUp));
  return app;
};

async function start() {
  const app = await application();
  app.listen(3000, () => console.log('http://localhost:3000'));
}

start();

Readme

Keywords

none

Package Sidebar

Install

npm i @martini97/healthcheck-middleware

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • martini97