gRPC Gateway
The web over the last few years has been consistently moving to a Frontend > Backend model where the backend is nothing more than a JSON API that JavaScript in the browser uses to render the page. Since gRPC relies on HTTP/2 as the transport, this means browsers can’t hit a gRPC server directly.
Since gRPC uses well defined messages and services with the protobuf definition language, you can easily generate code from these definitions. Using a tool called “grpc-gateway” you can actually make a fully functional JSON server that forwards requests to a running gRPC server. It handles the transcoding of the provided JSON to gRPC and vise versa.
From: https://github.com/grpc-ecosystem/grpc-gateway
Starting on the left, we define our protobufs and then generate a reverse proxy from them using the grpc-gateway tool. The tool will generate all of the endpoints in the protobuf’s “Service” definitions. From here, API clients (such as AJAX...