diff --git a/server.go b/server.go index 3f5484f4..477655b4 100644 --- a/server.go +++ b/server.go @@ -450,7 +450,9 @@ func (s *Server) Start() error { return nil } -// RegisterRoutes creates a new Router for this Server and runs the given `routeRegistrer`. +// RegisterRoutes runs the given `routeRegistrer` function with this Server and its router. +// The router's regex cache is cleared after the `routeRegistrer` function returns. +// This method should only be called once. func (s *Server) RegisterRoutes(routeRegistrer func(*Server, *Router)) { routeRegistrer(s, s.router) s.router.ClearRegexCache()