0.1.15 • Published 4 years ago

@tanand/health-check-plugin-manager v0.1.15

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

@tanand/health-check-plugin-manager

A health check plugin manager.

Install

npm install @tanand/health-check-plugin-manager

Usage

const healthCheckManager = require('@tanand/health-check-plugin-manager');
const mongoPlugin = require('@tanand/health-check-mongo-plugin');
const mysqlPlugin = require('@tanand/health-check-mysql-plugin');
const redisPlugin = require('@tanand/health-check-redis-plugin');

healthCheckManager.configure({
    port: 3000,
    runChecking: true,
    checkingInterval: 10000,
});

healthCheckManager.addPlugin([
    mongoPlugin.create({
        host: '127.0.0.1',
        port: 27017
    }),
    mysqlPlugin.create({
        user: 'username',
        password: 'password',
        database: 'database_name'
    }),
    redisPlugin.create({
        password: 'password'
    })
]);

healthCheckManager.start();

The manager will run an express server on the configure port and provide the following endpoint to get health report and perform some operations:

Endpoint to get the health report of your service plugin.

// GET
'/health-status'

Endpoint to get running service list

// GET
'/service-list'

Endpoint to start health check

//GET
'/start-health-check'

Endpoint to stop health check

// GET
'/stop-health-check'

Endpoint to set health check interval

// POST
// payload = { interval: 10000 }
'/set-interval'
0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago