2abe584b by astaxie

support restful router

1 parent ee9223b1
Showing 1 changed file with 8 additions and 2 deletions
......@@ -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
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!