Golang server behind envoy proxy that communicates with a react client (typescript) via grpc (demo)
- Create react app with typescript support
npx create-react-app client --typescript
- create client/proto folder
yarn add google-protobuf grpc grpc-web
- generate client proto libraries
protoc -I todo/ todo/todo.proto --js_out=import_style=commonjs:client/src/proto --grpc-web_out=import_style=typescript,mode=grpcwebtext:client/src/proto
- add /* eslint-disable */ to generated *.js files to make tslint happy
- Generate go models
protoc -I todo/ todo/todo.proto --go_out=plugins=grpc:todo
- build envoy docker image:
docker build -t abarbarov/go-envoy-boilerplate:v1 .
- run go server
go run server.go
- run envoy proxy
docker run -d -p 9090:9090 abarbarov/go-envoy-boilerplate:v1
- run client app
yarn start