1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/examples/gateway
2021-09-30 12:15:09 +01:00
..
proto/hello Add examples 2020-12-26 15:17:20 +00:00
main.go examples at v3 2021-01-20 21:28:48 +00:00
README.md Fix missing content type (#2289) 2021-09-30 12:15:09 +01:00

GRPC Gateway

This directory contains a grpc gateway generated using grpc-ecosystem/grpc-gateway.

Services written with asim/go-micro/service/grpc are fully compatible with the grpc-gateway and any other grpc services.

Go to grpc-ecosystem/grpc-gateway for details on how to generate gateways. We have generated the gateway from the same proto as the greeter server but with additional options for the gateway.

Usage

Run the go.micro.srv.greeter service

go run ../greeter/srv/main.go --server_address=localhost:9090

Run the gateway

go run main.go

Curl your request at the gateway (localhost:8080)

curl -H "content-type: application/json" -d '{"name": "john"}' http://localhost:8080/greeter/hello