From 1e48fa46cc1a06f0013d74383b8fc41e0bf33ee3 Mon Sep 17 00:00:00 2001 From: Levente Nas Date: Thu, 7 Nov 2024 22:05:53 +0100 Subject: [PATCH] feat: add subpath handler for simplerouter --- unstable/simplerouter/router.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unstable/simplerouter/router.go b/unstable/simplerouter/router.go index 990a9aa..76eb866 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) 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) }