This page will show you how to quickly build and run an end-to-end Echo example. The example has 3 key components:
- Front-end JS client
- Nginx gateway
- gRPC backend server (written in C++)
Before you start, ensure that you have the following installed exactly as per our pre-requisites:
- Protocol buffers
- gRPC
- Closure compiler
From the repo root directory:
$ docker build -t grpc-web --build-arg with_examples=true \
-f net/grpc/gateway/docker/ubuntu_16_04/Dockerfile .
$ docker run -t -p 8080:8080 grpc-web
Open a browser tab, and inspect
http://<hostname>:8080/net/grpc/gateway/examples/echo/echotest.html
From the repo root directory:
$ make # build nginx
# on MacOS, you might have to do this instead
# KERNEL_BITS=64 make
$ make example # build end-to-end example
$ sudo make install-example
- Run the gRPC backend server (written in C++)
$ cd net/grpc/gateway/examples/echo && ./echo_server &
- Run the gRPC Nginx Gateway
$ cd gConnector && ./nginx.sh &
- Open a browser tab, and inspect
http://<hostname>:8080/net/grpc/gateway/examples/echo/echotest.html
For more details about how you can run your own gRPC service and access it from the browser, please see this tutorial