grpc-node/packages/grpc-reflection
Filippo Spinella bda01f97f4 fix README 2023-12-14 18:56:05 +01:00
..
images feat(grpc-reflection): created new grpc-reflection package ported from nestjs-grpc-reflection library 2023-11-08 22:39:06 -05:00
proto refactor(grpc-reflection): file cleanup and enabled ts strict mode 2023-11-08 22:43:18 -05:00
src Fix issue #2631 2023-12-14 13:53:18 +01:00
test refactor(grpc-reflection): switch to using protobufjs library for message encoding/decoding 2023-11-18 19:13:59 -05:00
LICENSE feat(grpc-reflection): created new grpc-reflection package ported from nestjs-grpc-reflection library 2023-11-08 22:39:06 -05:00
README.md fix README 2023-12-14 18:56:05 +01:00
gulpfile.ts feat(grpc-reflection): created new grpc-reflection package ported from nestjs-grpc-reflection library 2023-11-08 22:39:06 -05:00
package.json grpc-reflection: Increment version to 1.0.1 2023-12-14 10:38:11 -05:00
tsconfig.json refactor(grpc-reflection): file cleanup and enabled ts strict mode 2023-11-08 22:43:18 -05:00

README.md

gRPC Reflection

gRPC reflection API service for use with gRPC-node.

Background

This package provides an implementation of the gRPC Server Reflection Protocol service which can be added to an existing gRPC server. Adding this service to your server will allow clients such as postman to dynamically load the API specification from your running application rather than needing to pass around and load proto files manually.

example of reflection working with postman

Installation

Use the package manager npm to install @grpc/reflection.

npm install @grpc/reflection

Usage

Any gRPC-node server can use @grpc/reflection to expose reflection information about their gRPC API.

import { ReflectionService } from '@grpc/reflection';

const pkg = protoLoader.load(...); // Load your gRPC package definition as normal

// Create the reflection implementation based on your gRPC package and add it to your existing server
const reflection = new ReflectionService(pkg);
reflection.addToServer(server);

Congrats! Your server now allows any client to request reflection information about its API.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. The original proposal for this library can be found in gRFC L108

Please make sure to update tests as appropriate.

License

Apache License 2.0