1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 23:50:56 +00:00

support restful router

This commit is contained in:
astaxie 2013-07-08 18:35:10 +08:00
parent ee9223b1b9
commit 2abe584bc5

View File

@ -180,8 +180,14 @@ func RegisterController(path string, c ControllerInterface) *App {
return BeeApp return BeeApp
} }
func Router(path string, c ControllerInterface) *App { func Router(rootpath string, c ControllerInterface) *App {
BeeApp.Router(path, c) BeeApp.Router(rootpath, c)
return BeeApp
}
func RESTRouter(rootpath string, c ControllerInterface) *App {
Router(rootpath, c)
Router(path.Join(rootpath, ":objectId"), c)
return BeeApp return BeeApp
} }