npm.io
1.3.10 • Published 2 years ago

@himenon/ts-grpc-health-check

Licence
MIT
Version
1.3.10
Deps
0
Size
27 kB
Vulns
0
Weekly
0

@himenon/ts-grpc-health-check

Usage

npm i @himenon/ts-grpc-health-check
# or
pnpm i @himenon/ts-grpc-health-check
import health from "@himenon/ts-grpc-health-check";

const statusMap = {
  ServiceFoo: proto.grpc.health.v1.HealthCheckResponse.ServingStatus.SERVING,
  ServiceBar: proto.grpc.health.v1.HealthCheckResponse.ServingStatus.NOT_SERVING,
  "": proto.grpc.health.v1.HealthCheckResponse.ServingStatus.NOT_SERVING,
};

const healthImpl = health.createHealthServerImpl(statusMap);

// Add the service and implementation to your pre-existing gRPC-node server
server.addService(health.service, healthImpl);

Development

pnpm i
# For Apple Silicon
npm_config_target_arch=x64 npm_config_arch=x64 pnpm i

Release

  • Automatic version updates are performed when merged into the main branch.

LICENCE

@Himenon/template-esm-js・MIT

Keywords