nice-grpc-server-reflection
TypeScript icon, indicating that this package has built-in type declarations

2.0.10 • Public • Published

nice-grpc-server-reflection npm version

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();

// add our own service
server.add(MyService, myServiceImpl);

// add server reflection service
server.add(
  ServerReflectionService,
  ServerReflection(
    fs.readFileSync(path.join('path', 'to', 'protoset.bin')),
    // specify fully-qualified names of exposed services
    [MyService.fullName],
  ),
);

Package Sidebar

Install

npm i nice-grpc-server-reflection

Weekly Downloads

8,564

Version

2.0.10

License

MIT

Unpacked Size

195 kB

Total Files

15

Last publish

Collaborators

  • aikoven