Skip to content

Commit

Permalink
Merge pull request #504 from hello-wn/feat-rpc
Browse files Browse the repository at this point in the history
feat(template): enable grpc reflection
  • Loading branch information
nicholasxuu authored Aug 28, 2023
2 parents 1dbd7d6 + 5bb1956 commit f8e9963
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/gobay/pkged.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions cmd/gobay/templates/app/grpc/server.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"google.golang.org/grpc/health/grpc_health_v1"

myapp "{{ $.Url }}/app"
"google.golang.org/grpc/reflection"
)

// Serve grpc server
Expand Down Expand Up @@ -64,6 +65,8 @@ func Serve(app *gobay.Application) error {

configureAPI(server, &{{ toLowerCamel $.Name}}Server{app: app})

// Register reflection service on gRPC server.
reflection.Register(server)
// 启动 prometheus handler
grpc_prometheus.Register(server)
promSrv := http.Server{Addr: ":9000"}
Expand Down

0 comments on commit f8e9963

Please sign in to comment.