Starts the HTTP server.
(ctx context.Context)
| 144 | |
| 145 | // Starts the HTTP server. |
| 146 | func (s *Server) ServeHTTP(ctx context.Context) error { |
| 147 | handler, err := s.HTTPHandler(ctx) |
| 148 | if err != nil { |
| 149 | return err |
| 150 | } |
| 151 | |
| 152 | return graceful.ServeHTTP(ctx, handler, graceful.ServeOptions{ |
| 153 | Port: s.opts.HTTPPort, |
| 154 | GRPCPort: s.opts.GRPCPort, |
| 155 | Logger: s.logger, |
| 156 | }) |
| 157 | } |
| 158 | |
| 159 | // HTTPHandler returns a HTTP handler that serves REST and gRPC. |
| 160 | func (s *Server) HTTPHandler(ctx context.Context) (http.Handler, error) { |
no test coverage detected