mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
mux: run http server if gateway | grpcWeb | react | mux is defined
goroutines: use errgroup Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -28,9 +28,9 @@ func (s *service) grpcWeb(opts ...grpcweb.Option) error {
|
||||
h := grpcweb.WrapServer(s.server, append(defaultWebOptions, opts...)...)
|
||||
for _, v := range grpcweb.ListGRPCResources(s.server) {
|
||||
if s.opts.grpcWebPrefix != "" {
|
||||
s.opts.mux.Handle(s.opts.grpcWebPrefix+v, http.StripPrefix(s.opts.grpcWebPrefix, h))
|
||||
s.lazyMux().Handle(s.opts.grpcWebPrefix+v, http.StripPrefix(s.opts.grpcWebPrefix, h))
|
||||
} else {
|
||||
s.opts.mux.Handle(v, h)
|
||||
s.lazyMux().Handle(v, h)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -44,6 +44,6 @@ func (s *service) reactApp() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.opts.mux.Handle("/", h)
|
||||
s.lazyMux().Handle("/", h)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user