feat: add subpath handler for simplerouter

This commit is contained in:
Levente Nas
2024-11-07 22:05:53 +01:00
parent 88b3d9fa34
commit 1e48fa46cc

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) HandleSubpath(path string, handler http.Handler) {
rg.mux.Handle(path, handler)
}
func (rg *RouteGroup) GET(path string, handler http.Handler) {
rg.Handle(http.MethodGet, path, handler)
}