This is a tool to help you interact with gRPC services. You can use it to explore the service's endpoints and make requests to them, browse types and enums, and preview options.
To run this application, you need to have the libraries installed.
pnpm install
Here are the commands you can use to run the application or generate JSON prescription for the proto files.
To run the website in development mode, use the following command.
pnpm -C web run dev
To run the website in production mode, use the following commands. First, build the website and then start the server. The server will be available at http://localhost:3000 by default.
pnpm -C web run build
pnpm -C web run start
Generate a JSON from the proto files. The source files can be a single file or a list of files separated by a space or a folder/folders.
gf-proto-to-json ${SOURCE_PROTO_FILES} > ${EXPORTED_NAME}.json
- Create a protoset file (it can be done using different ways, this is just an example).
grpcurl -protoset-out descriptors.bin -plaintext localhost:8980 describe
- Generate a JSON from the protoset file. The file should be a single file in the .bin format.
gf-reflection-to-json ${SOURCE_BIN_FILE} > ${EXPORTED_NAME}.json
To test the application, you can use the example testing server and Envoy proxy. It is a simple gRPC server that has a few endpoints and types. Source: https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld
- Go to the example folder.
cd example
- Start the Envoy proxy.
(Linux users: Use address: localhost instead of address: host.docker.internal in the bottom section.)
docker run -d -v "$(pwd)"/envoy-proxy.yaml:/etc/envoy/envoy.yaml:ro -p 8080:8080 -p 9901:9901 envoyproxy/envoy:v1.22.0
- Run the gRPC server.
node server.js
- Access the (already running) website and set the server URL to http://localhost:8080.