Add Group

This commit is contained in:
Nise Void 2018-08-19 17:03:53 +02:00
parent f4d27689e7
commit 78000acf6c
Signed by untrusted user: NiseVoid
GPG key ID: FBA14AC83EA602F3
2 changed files with 53 additions and 0 deletions

View file

@ -29,6 +29,10 @@ func New() *Router {
return &Router{}
}
func (r *Router) Group(prefix string) *Group {
return &Group{prefix: prefix, router: r}
}
// GET adds a GET route
func (r *Router) GET(path string, handle GetHandle) {
r.routes = append(r.routes, route{`GET`, path, handle})