examples/

directory
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause

README

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.

Directories

Path Synopsis
clients
abe
cmd
example-gateway-server
Command example-gateway-server is an example reverse-proxy implementation whose HTTP handler is generated by grpc-gateway.
Command example-gateway-server is an example reverse-proxy implementation whose HTTP handler is generated by grpc-gateway.
example-grpc-server
Command example-grpc-server is an example grpc server to be called by example-gateway-server.
Command example-grpc-server is an example grpc server to be called by example-gateway-server.
Package gateway is an example of grpc-gateway server
Package gateway is an example of grpc-gateway server
pbwrappers
helloworld
Package helloworld is a reverse proxy.
Package helloworld is a reverse proxy.
proto
examplepb
Package examplepb is a reverse proxy.
Package examplepb is a reverse proxy.
sub

Jump to

Keyboard shortcuts

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