check / check (push) Waiting to run
With SENTRY_DSN set, the server initialises sentry-go with the release netwatch-server-<version>, adds the sentryhttp middleware with Repanic as the last router-wide middleware, after the timeout, and flushes Sentry for 2 seconds on shutdown. A DSN Sentry refuses stops the start with an error naming SENTRY_DSN. With it empty, nothing is set up. The metrics middleware stays on the matched routes only, so it runs inside the Sentry middleware rather than before it. Model: opus-5-5
20 lines
505 B
Go
20 lines
505 B
Go
package server
|
|
|
|
import "github.com/go-chi/chi/v5"
|
|
|
|
// Router exposes the router to the external tests, which add routes
|
|
// of their own to it after SetupRoutes.
|
|
func (s *Server) Router() *chi.Mux {
|
|
return s.router
|
|
}
|
|
|
|
// MaxRequestBodyBytes exposes the router-wide body limit to the
|
|
// external tests.
|
|
const MaxRequestBodyBytes = maxRequestBodyBytes
|
|
|
|
// ListenAddr exposes the address the server listens on to the
|
|
// external tests.
|
|
func (s *Server) ListenAddr() string {
|
|
return s.newHTTPServer().Addr
|
|
}
|