grpc-web-go-react-example

command module
v0.0.0-...-644423a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2022 License: MIT Imports: 8 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL