This is an example app that uses the following:
- gRPC-Web
- golang web server
- create-react-app web app
- envoy
This app demonstrates how to integrate and use gRPC-Web
in a create-react-app
that is communicating to a golang gRPC
server.
Envoy
is used to proxy all gRPC-Web
call from the web to the server.
-
Install
protoc
from here. -
Install
protoc-gen-grpc-web
from here.$ sudo mv ~/Downloads/protoc-gen-grpc-web-1.0.6-darwin-x86_64 \ /usr/local/bin/protoc-gen-grpc-web $ chmod +x /usr/local/bin/protoc-gen-grpc-web
- On the root folder run this command:
$ docker-compose -f ./deployments/docker-compose.yaml up --build
- Open a browser to
http://localhost:3001
and (for now) inspect the console, you should see something a log like this:> API_URL>>> http://localhost:8080 > response>>> Hello World! from server
- Note: take a look at the
web/src/client.js
file where this log is printed out.
- Note: take a look at the