From 68d274c067443f7b4b651b8746025ac1efabacbf Mon Sep 17 00:00:00 2001 From: Levente Batuska Date: Sat, 9 Nov 2024 18:51:12 +0100 Subject: [PATCH] feat(SimpleRouter): add new subpath handling method --- unstable/simplerouter/router.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unstable/simplerouter/router.go b/unstable/simplerouter/router.go index 990a9aa..d65ea54 100644 --- a/unstable/simplerouter/router.go +++ b/unstable/simplerouter/router.go @@ -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) }