An open API service indexing awesome lists of open source software.

https://github.com/hakobe/grpc-gateway-example

little grpc-gateway example
https://github.com/hakobe/grpc-gateway-example

Last synced: about 1 year ago
JSON representation

little grpc-gateway example

Awesome Lists containing this project

README

          

# grpc-gateway example

This is a tiny example of gRPC server and its REST like JSON API gateway generated by [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway).

This project consists of following files.

- `article.proto`: protocol buffer data structure and service definition
- `articles/*`: generated code from `article.proto`
- `server/server.go`: gRPC server for articles
- `gateway/gateway.go`: grpc-gateway server for articles

To try this code you may want to run following commands.

```console
# install protoc first https://github.com/google/protobuf/releases

# setup tools
$ go get -u google.golang.org/grpc
$ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
$ go get -u github.com/golang/protobuf/protoc-gen-go

# run
$ make
$ make run
```