zcong1993 / node-grpc-health-check

Health check client and service for use with @grpc/grpc-js.
MIT License
0 stars 1 forks source link
grpc grpc-health grpc-js grpc-node

node-grpc-health-check

NPM version NPM downloads codecov JS Test

Health check client and service for use with @grpc/grpc-js.

Background

This package exports both a client and server that adhere to the gRPC Health Checking Protocol.

Why not grpc-health-check

Features

Install

$ yarn add @zcong/node-grpc-health-check
# or npm
$ npm i @zcong/node-grpc-health-check --save

Usage

Server

import { HealthImplementation, service, ServingStatus } from '../src'

const server = new grpc.Server()
const h = new HealthImplementation({
  '': ServingStatus.NOT_SERVING,
  test1: ServingStatus.SERVING,
})
server.addService(service, h)

Client

Any gRPC-node client can use @zcong/node-grpc-health-check to run health checks against other servers that follow the protocol.

Full examples can be viewed at ./example.

License

MIT © zcong1993