mirror of
https://github.com/astaxie/beego.git
synced 2025-06-22 05:10:17 +00:00
support restful router
This commit is contained in:
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user