...

Text file src/github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/README.md

Documentation: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal

     1# One way to run the example
     2
     3```bash
     4# Handle dependencies
     5$ dep init
     6```
     7
     8Follow the guides from this [README.md](./browser/README.md) to run the server and gateway.
     9```bash
    10# Make sure you are in the correct directory: 
    11# $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/v2/examples
    12$ cd examples/internal/browser
    13$ pwd
    14
    15# Install gulp
    16$ npm install -g gulp-cli
    17$ npm install
    18$ gulp
    19
    20# Run
    21$ gulp bower
    22$ gulp backends
    23```
    24
    25Then you can use curl or a browser to test:
    26
    27```bash
    28# List all apis
    29$ curl http://localhost:8080/openapiv2/echo_service.swagger.json
    30
    31# Visit the apis
    32$ curl -XPOST http://localhost:8080/v1/example/echo/foo
    33{"id":"foo"}
    34
    35$ curl  http://localhost:8080/v1/example/echo/foo/123
    36{"id":"foo","num":"123"}
    37
    38```
    39
    40So you have visited the apis by HTTP successfully. You can also try other apis.

View as plain text