3.1.6 • Published 6 months ago

@fonoster/grpc-health-check v3.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

gRPC Health Check

An implementation of gRPC health checks, for node.js-based apps that uses @grpc/grpc-js as a base.

Installation

yarn add git+https://github.com/fonoster/grpc-health-check.git

Usage

/**
 * server.ts
 */
import * as grpc from '@grpc/grpc-js';
import { useHealth } from '@fonoster/grpc-health-check';

const server = useHealth(new grpc.Server());

server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => server.start());
/**
 * client.ts
 */
import * as grpc from '@grpc/grpc-js';
import { HealthClient } from '@fonoster/grpc-health-check';

const health = new HealthClient('localhost:50051');

const { status } = await health.check('SERVICE');

console.info('The app is ready to serve!', status);

Authors

This repository is a clone of kalos, thanks to Nicolas Pearson for his implementation.

License

Released under the MIT License. Extended from kalos repository.