Giter Club home page Giter Club logo

grpcflair's Introduction

gRPCFlair

codecov

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.

preview

Prerequisites

To run this application, you need to have the libraries installed.

pnpm install

Usage

Here are the commands you can use to run the application or generate JSON prescription for the proto files.

Website

Development

To run the website in development mode, use the following command.

pnpm -C web run dev

Production

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

JSON Generation

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

Reflection to JSON Generation

  1. 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
  1. 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

Testing Server

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

  1. Go to the example folder.
cd example
  1. 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
  1. Run the gRPC server.
node server.js
  1. Access the (already running) website and set the server URL to http://localhost:8080.

grpcflair's People

Contributors

dobrac avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.