MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / ensureRouter

Method ensureRouter

internal/server/server.go:1724–1728  ·  view source on GitHub ↗

ensureRouter lazily initializes the router on first use, so all Set* configuration is applied before the middleware chain is built.

()

Source from the content-addressed store, hash-verified

1722// ensureRouter lazily initializes the router on first use, so all Set*
1723// configuration is applied before the middleware chain is built.
1724func (s *Server) ensureRouter() {
1725 s.routerOnce.Do(func() {
1726 s.setupRouter()
1727 })
1728}
1729
1730func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
1731 s.ensureRouter()

Callers 4

SetWebUIMethod · 0.95
ServeHTTPMethod · 0.95
ListenAndServeMethod · 0.95
HandlerMethod · 0.95

Calls 1

setupRouterMethod · 0.95

Tested by

no test coverage detected