gateway

HTTP to gRPC gateway standalone. An example of go-zero gateway.

Install

go install github.com/kevwan/[email protected]

Usage

Example config:

Name: gateway
Host: localhost
Port: 8888
Upstreams:
  - Grpc:
      Etcd:
        Hosts:
          - localhost:2379
        Key: hello.rpc
    # protoset mode
    ProtoSet: hello.pb
    Mapping:
      - Method: get
        Path: /pingHello/:ping
        Rpc: hello.Hello/Ping
  - Grpc:
      Endpoints:
        - localhost:8081
    # no protoset, reflection mode
    # remember to enable reflection in server side
    Mapping:
      - Method: post
        Path: /pingWorld
        Rpc: world.World/Ping

Run the gateway

gateway -f config.yaml

Give a Star! ⭐

If you like or are using this project, please give it a star. Thanks!

GitHub

View Github