+1
−0
+2
−0
+33
−13
+0
−10
+11
−3
Loading
Replace the stdlib net/http.ServeMux default with go-chi/chi, exposing
Chi's key features through the Router interface while keeping Chi types
out of the public API (design requirement from team-tasks#4283).
Router interface changes:
- Add method-specific registration: Get, Post, Put, Delete, Patch
- Add route grouping: Group (scoped middleware), Route (path prefix)
- Add sub-router mounting: Mount
- Add per-route middleware: With
- Add error handler customization: NotFound, MethodNotAllowed
- Add URLParam helper for path parameter extraction
Architecture changes:
- Default Router backed by chi.Mux (wrapped in unexported chiRouter)
- Built-in middleware (tracing, logging) registered via Use before user
routes, running inside chi's routing context for access to route
patterns
- Health endpoints (/-/liveness, /-/readiness) handled by Server.ServeHTTP
directly, outside the user's route tree
- Tracing middleware uses chi.RouteContext for low-cardinality span names
(e.g. "GET /users/{id}" instead of "GET /users/42")
- Compile-time app.Component assertion added
Removed:
- routerbench standalone benchmark module (Chi/Gorilla/stdlib comparison
served its purpose during the investigation phase)