~blainsmith/grpc-gateway-openapi-example

Just an example of creating a gRPC service and generating an OpenAPI spec then exposing it over HTTP too.
adding license
bafff62a — Blain Smith 1 year, 7 months ago
init
d6e0c48d — Blain Smith 1 year, 7 months ago
Initial commit

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~blainsmith/grpc-gateway-openapi-example
read/write
git@git.sr.ht:~blainsmith/grpc-gateway-openapi-example

You can also use your local clone with git send-email.

#grpc-gateway-openapi-example

Just an example of creating a gRPC service and generating an OpenAPI spec then exposing it over HTTP too.

#Tools

#Running

> go run cmd/example.go
2022/07/20 16:15:13 gRPC server ready on localhost:5566...
2022/07/20 16:15:13 HTTP server ready on localhost:8080...

Open http://localhost:8080/swagger-ui/ to view the generated docs. The UI is literally copied from https://github.com/swagger-api/swagger-ui/tree/master/dist as that is the intended use of it.

#Modifying protos/service.proto

If you modify this file you need to rebuild and regenerate files. We use the buf CLI to do this.

> buf build

> buf generate