0.1.15 • Published 6 years ago

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

Weekly downloads
1
License
MIT
Repository
-
Last release
6 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

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago