Skip to content

Example of using Go and React/TypeScript with gRPC-Web

License

ak-rus/grpc-web-go-react-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small Go/React/TypeScript gRPC-Web example

This is a tiny example set up for using gRPC-Web with Go and React, powered by https://github.com/timostamm/protobuf-ts for the client and grpc-go and https://github.com/improbable-eng/grpc-web for the server.

Bundling is handled by esbuild.github.io.

Requirements

  1. Go
  2. Docker (to run npm 🤢)

Install tools

$ make install

Running

$ make serve
go run main.go
Serving on http://0.0.0.0:8080

Regenerate protobuf

$ make generate
buf generate

Bundle JS

$ make bundle
esbuild ./frontend/app.tsx --bundle --minify --sourcemap --outfile=./dist/js/bundle.js

  dist/js/bundle.js      189.0kb
  dist/js/bundle.js.map  559.6kb

⚡ Done in 61ms

About

Example of using Go and React/TypeScript with gRPC-Web

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.1%
  • Go 5.7%
  • Makefile 1.2%