reg/vendor/github.com/grpc-ecosystem/grpc-gateway/examples
Jess Frazelle 843aebf2c1
update deps
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-07-14 11:48:41 -04:00
..
browser update deps 2018-07-14 11:48:41 -04:00
clients update deps 2018-07-14 11:48:41 -04:00
cmd update deps 2018-07-14 11:48:41 -04:00
gateway update deps 2018-07-14 11:48:41 -04:00
integration update deps 2018-07-14 11:48:41 -04:00
proto update deps 2018-07-14 11:48:41 -04:00
server update deps 2018-07-14 11:48:41 -04:00
README.md update deps 2018-07-14 11:48:41 -04:00

One way to run the example

# Handle dependencies
$ dep init

Follow the guides from this README.md to run the server and gateway.

# Make sure you are in the correct directory: 
# $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/examples
$ cd examples/browser
$ pwd

# Install gulp
$ npm install -g gulp-cli
$ npm install
$ gulp

# Run
$ gulp bower
$ gulp backends

Then you can use curl or a browser to test:

# List all apis
$ curl http://localhost:8080/swagger/echo_service.swagger.json

# Visit the apis
$ curl -XPOST http://localhost:8080/v1/example/echo/foo
{"id":"foo"}

$ curl  http://localhost:8080/v1/example/echo/foo/123
{"id":"foo","num":"123"}

So you have visited the apis by HTTP successfully. You can also try other apis.