Skip to content

Commit

Permalink
Docs: update Server.RegisterRoutes docs
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Sep 27, 2024
1 parent 3983fc5 commit ab836b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ab836b4

Please sign in to comment.