Subpath handler for simplerouter #6

Closed
naslevente wants to merge 3 commits from router-feat into master
Showing only changes of commit 1e48fa46cc - Show all commits

View File

@@ -136,6 +136,10 @@ func (rg *RouteGroup) Handle(method string, path string, handler http.Handler) {
rg.HandleFunc(method, path, handler.ServeHTTP) 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) { func (rg *RouteGroup) GET(path string, handler http.Handler) {
rg.Handle(http.MethodGet, path, handler) rg.Handle(http.MethodGet, path, handler)
} }