nice-grpc-server-reflection
Server Reflection
for nice-grpc.
Allows to use tools like grpcurl
without the need to pass .proto
files.
Installation
npm install nice-grpc-server-reflection
Usage
Add the following flags to protoc
command:
--descriptor_set_out=path/to/protoset.bin --include_imports
Add ServerReflection
service implementation to gRPC server:
import {createServer} from 'nice-grpc';
import {
ServerReflectionService,
ServerReflection,
} from 'nice-grpc-server-reflection';
import * as fs from 'fs';
const server = createServer();
server.add(MyService, myServiceImpl);
server.add(
ServerReflectionService,
ServerReflection(
fs.readFileSync(path.join('path', 'to', 'protoset.bin')),
[MyService.fullName],
),
);