1.0.0 • Published 4 years ago

@xclbr/healthcheck v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Healthcheck

NPM version

This package contains whole Healthcheck server based on Express and Express middleware which can be used in your application. After deploing you can reach health endpoint at:

http://your-server-name/healthz

Sample return is HTTP Status Code 200 and:

{"status":"OK","uptime":14.8367612}

If you deploy it on non-express application, you can specify listening port via environmet variable HEALTHCHECK_PORT or directly in Healthcheck.Run method.

Usage

in Express application

const express = require('express');
const Healthcheck = require('@xclbr/healthcheck');

const app = express();
app.use(Healthcheck.handler);

in non-express application

const Healthcheck  = require('@xclbr/healthcheck');

Healthcheck.Run(); //default port 80