Skip to content

feat: Server.Routes() for route listing and introspection #53

@FumingPower3925

Description

@FumingPower3925

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiPublic-facing API surfaceenhancementNew feature or requestsize/S~1 day of work

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions