feat(SimpleRouter): add new subpath handling method

This commit is contained in:
2024-11-09 18:51:12 +01:00
parent 88b3d9fa34
commit 68d274c067

View File

@@ -136,6 +136,10 @@ func (rg *RouteGroup) Handle(method string, path string, handler http.Handler) {
rg.HandleFunc(method, path, handler.ServeHTTP)
}
func (rg *RouteGroup) SubpathHandle(path string, handler http.Handler) {
rg.Handle("", path, handler)
}
func (rg *RouteGroup) GET(path string, handler http.Handler) {
rg.Handle(http.MethodGet, path, handler)
}