1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:40:55 +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
}
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
}