Summary
Add Server.Routes() []RouteInfo that returns a list of all registered routes with their method, path, and handler count.
type RouteInfo struct {
Method string
Path string
Handlers int // number of handlers in the chain (middleware + endpoint)
}
Motivation
Useful for debug endpoints, documentation generation, and development-time introspection. Gin, Echo, and Fiber all provide route listing.
Scope
- Walk the radix trie per method tree, reconstruct full paths.
- Return sorted by method + path.
- Expose via
Server.Routes() (not Router — Router is exported but has no public methods).
Non-breaking
Additive method on Server. No existing API changes required.
Summary
Add
Server.Routes() []RouteInfothat returns a list of all registered routes with their method, path, and handler count.Motivation
Useful for debug endpoints, documentation generation, and development-time introspection. Gin, Echo, and Fiber all provide route listing.
Scope
Server.Routes()(notRouter— Router is exported but has no public methods).Non-breaking
Additive method on
Server. No existing API changes required.