Skip to content

Golang server behind envoy proxy that communicates with a react client (typescript) via grpc (demo)

License

Notifications You must be signed in to change notification settings

abarbarov/go-envoy-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang server behind envoy proxy that communicates with a react client (typescript) via grpc (demo)

Client

  1. Create react app with typescript support
npx create-react-app client --typescript
  1. create client/proto folder
yarn add google-protobuf grpc grpc-web
  1. 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
  1. add /* eslint-disable */ to generated *.js files to make tslint happy

Server

  1. Generate go models
protoc -I todo/ todo/todo.proto --go_out=plugins=grpc:todo

Envoy proxy

  1. build envoy docker image:
docker build -t abarbarov/go-envoy-boilerplate:v1 .

Run everything

  1. run go server
go run server.go
  1. run envoy proxy
docker run -d -p 9090:9090 abarbarov/go-envoy-boilerplate:v1
  1. run client app
yarn start

About

Golang server behind envoy proxy that communicates with a react client (typescript) via grpc (demo)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published