Health check client and service for use with @grpc/grpc-js.
This package exports both a client and server that adhere to the gRPC Health Checking Protocol.
Why not grpc-health-check
grpc-health-check
is for deprecated native grpc package not for @grpc/grpc-jsgrpc-health-check
implements an expired protocol ofgRPC Health Checking Protocol
not the latest version
- 100% Typescript
- implements the latest version of
gRPC Health Checking Protocol
- API is similar to
grpc-health-check
- support
shutdown
andresume
method likegrpc-go
$ yarn add @zcong/node-grpc-health-check
# or npm
$ npm i @zcong/node-grpc-health-check --save
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)
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.
MIT © zcong1993