github.com/micro/go-micro/examples@v0.0.0-20210105173217-bf4ab679e18b/gateway/README.md (about)

     1  # GRPC Gateway
     2  
     3  This directory contains a grpc gateway generated using [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway).
     4  
     5  Services written with [micro/go-micro/service/grpc](https://github.com/micro/go-micro/service/grpc) are fully compatible with the grpc-gateway and any other 
     6  grpc services.
     7  
     8  Go to [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) for details on how to generate gateways. We 
     9  have generated the gateway from the same proto as the greeter server but with additional options for the gateway.
    10  
    11  ## Usage
    12  
    13  Run the go.micro.srv.greeter service
    14  
    15  ```
    16  go run ../greeter/srv/main.go --server_address=localhost:9090
    17  ```
    18  
    19  Run the gateway
    20  
    21  ```
    22  go run main.go
    23  ```
    24  
    25  Curl your request at the gateway (localhost:8080)
    26  
    27  ```
    28  curl -d '{"name": "john"}' http://localhost:8080/greeter/hello
    29  ```