In order to build, Go to Go
module root directory location (grpc-gateway/go/server) and execute the following
shell command,
go build -i -v -o bin/server
In order to run, Go to Go
module root directory location (grpc-gateway/go/server) and execute the following
shell command,
./bin/server
In order to build, Go to Go
module root directory location (grpc-gateway/go/client) and execute the following
shell command,
go build -i -v -o bin/client
In order to run, Go to Go
module root directory location (grpc-gateway/go/client) and execute the following
shell command,
./bin/client
- Add a new product to the ProductInfo service.
$ curl -X POST http://localhost:8081/v1/product -d '{"name": "Apple", "description": "iphone7", "price": 699}'
"38e13578-d91e-11e9-819f-6c96cfe0687d"
- Get the existing product using ProductID
$ curl http://localhost:8081/v1/product/38e13578-d91e-11e9-819f-6c96cfe0687d
{"id":"38e13578-d91e-11e9-819f-6c96cfe0687d","name":"Apple","description":"iphone7","price":
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. \
product_info.proto
go get -u github.com/grpc-up-and-running/samples/ch08/grpc-gateway/go/pb
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--grpc-gateway_out=logtostderr=true:. \
product_info.proto
go get -u github.com/grpc-up-and-running/samples/ch08/grpc-gateway/go/gw
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--swagger_out=logtostderr=true:. \
product_info.proto