gRPC Reflection
gRPCity’s server speaks the gRPC Server Reflection Protocol, so tools like Postman or grpcurl can introspect your service over the wire without a local copy of the .proto files.
Usage
Build a reflection service from the loader and inject it into the server:
const server = await loader.initServer()
const reflection = await loader.initReflection()
server.inject(reflection)Unary Call
We use the example/reflection/helloworldServer.js in gRPCity as an example of a Unary Call.
Terminal
node example/reflection/helloworldServer.js
start: localhost:9098After the service starts, you can use Postman for integration testing, as demonstrated below:
Async Stream
We use the example/reflection/asyncStreamServer.js in gRPCity as an example of an Async Stream.
Terminal
node example/reflection/asyncStreamServer.js
start: localhost:9097After the service starts, you can use Postman for integration testing, as demonstrated below:
Client Stream
Server Stream
Bidi Stream
Last updated on