mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:30:56 +00:00
support restful router
This commit is contained in:
parent
ee9223b1b9
commit
2abe584bc5
10
beego.go
10
beego.go
@ -180,8 +180,14 @@ func RegisterController(path string, c ControllerInterface) *App {
|
||||
return BeeApp
|
||||
}
|
||||
|
||||
func Router(path string, c ControllerInterface) *App {
|
||||
BeeApp.Router(path, c)
|
||||
func Router(rootpath string, c ControllerInterface) *App {
|
||||
BeeApp.Router(rootpath, c)
|
||||
return BeeApp
|
||||
}
|
||||
|
||||
func RESTRouter(rootpath string, c ControllerInterface) *App {
|
||||
Router(rootpath, c)
|
||||
Router(path.Join(rootpath, ":objectId"), c)
|
||||
return BeeApp
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user