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
- Host: GitHub
- URL: https://github.com/hakobe/grpc-gateway-example
- Owner: hakobe
- Created: 2018-04-17T16:45:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-18T14:52:44.000Z (about 8 years ago)
- Last Synced: 2025-02-17T05:46:15.870Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```