1.0.0 • Published 3 years ago

health-heb v1.0.0

Weekly downloads
3
License
ISC
Repository
-
Last release
3 years ago

Healthy Check HEB

Revisión de los servicios de terceros aplicados, obtiene la valoración del estado que se encuentran. Con el fin de obtener un auto deploy, asegurando el funcionamiento del aplicativo.

Implement

Este paquete tiene como dependencia los siguientes modulos

npm install healthy-heb

Use

Instanciar el check a usar, pasando la configuración correspondiente

const { Health, RabbitCheck, PostgresCheck } = require('health-heb')
const healthCheck = new Health.HealthChecker()

// Todo: Implement Check ...

router.get('/live', Health.LivenessEndpoint(healthCheck))
router.get('/ready', Health.ReadinessEndpoint(healthCheck))
router.get('/health', Health.HealthEndpoint(healthCheck))

Check Rabbit

const { RabbitCheck } = require('health-heb')
const healthyRabbitCheck = new RabbitCheck(config)
const readinessRabbitCheck = new Health.ReadinessCheck('RabbitMQ', healthyRabbitCheck)
healthCheck.registerReadinessCheck(readinessRabbitCheck)

Archivo de configuración config object

config.PROTOCOL,
config.HOST,
config.PORT_SERVICE,
config.USER,
config.PASSWORD,
config.VHOST

Check Postgres

const { PostgresCheck } = require('health-heb')
const healthyPostgresCheck = new PostgresCheck(config)
const readinessPostgresCheck = new Health.ReadinessCheck('PostgresDB', healthyPostgresCheck)
healthCheck.registerReadinessCheck(readinessPostgresCheck)

Archivo de configuración config object

config.USER, 
config.PASSWORD,
config.HOST,
config.PORT,
config.DB