Skip to content

Commit

Permalink
chore: improve badge
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Nov 26, 2024
1 parent a1a1d8e commit e16df9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# gRPC gateway

[![Build and Test](https://github.com/go-kod/grpc-gateway/actions/workflows/go.yml/badge.svg)](https://github.com/go-kod/grpc-gateway/actions/workflows/go.yml)
[![codecov](https://codecov.io/gh/sysulq/graphql-grpc-gateway/graph/badge.svg?token=UO18DMG15Z)](https://codecov.io/gh/sysulq/graphql-grpc-gateway)
[![codecov](https://codecov.io/gh/go-kod/grpc-gateway/graph/badge.svg?token=UO18DMG15Z)](https://codecov.io/gh/go-kod/grpc-gateway)

This is a simple gateway that can be used to expose multiple gRPC services as a GraphQL/HTTP server.

Expand Down
12 changes: 4 additions & 8 deletions cmd/gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ type app struct {
func run(ctx context.Context, app *app) error {
cfg := app.config.Get().Config()

l, err := net.Listen("tcp", cfg.Server.GraphQL.Address)
lo.Must0(err)
l := lo.Must(net.Listen("tcp", cfg.Server.GraphQL.Address))
log.Printf("[INFO] Gateway listening on address: %s\n", l.Addr())
handler, err := app.server.Get().BuildServer()
lo.Must0(err)
handler := lo.Must(app.server.Get().BuildServer())
go func() { lo.Must0(http.Serve(l, handler)) }()

l, err = net.Listen("tcp", cfg.Server.HTTP.Address)
lo.Must0(err)
l = lo.Must(net.Listen("tcp", cfg.Server.HTTP.Address))
log.Printf("[INFO] Gateway listening on address: %s\n", l.Addr())
handler, err = app.server.Get().BuildHTTPServer()
lo.Must0(err)
handler = lo.Must(app.server.Get().BuildHTTPServer())
lo.Must0(http.Serve(l, handler))

return nil
Expand Down

0 comments on commit e16df9c

Please sign in to comment.