method GrpcService.prototype.addService
GrpcService.prototype.addService<TDef extends GrpcServiceDefinition>(
definition: TDef,
implementation?: unknown
): void

Registers a gRPC service definition with an optional implementation.

Type Parameters

Parameters

definition: TDef

The service descriptor (must satisfy GrpcServiceDefinition)

optional
implementation: unknown

Optional service implementation object; if omitted, the service is registered for reflection only

Return Type

void

Throws

Error

If a service with the same type name has already been registered

Usage

import { GrpcService } from "grpc-plugin/src/index.ts";