forked from Fuyu/router
Add Group
This commit is contained in:
parent
f4d27689e7
commit
78000acf6c
2 changed files with 53 additions and 0 deletions
|
@ -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})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue