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 { ...@@ -180,8 +180,14 @@ func RegisterController(path string, c ControllerInterface) *App {
180 return BeeApp 180 return BeeApp
181 } 181 }
182 182
183 func Router(path string, c ControllerInterface) *App { 183 func Router(rootpath string, c ControllerInterface) *App {
184 BeeApp.Router(path, c) 184 BeeApp.Router(rootpath, c)
185 return BeeApp
186 }
187
188 func RESTRouter(rootpath string, c ControllerInterface) *App {
189 Router(rootpath, c)
190 Router(path.Join(rootpath, ":objectId"), c)
185 return BeeApp 191 return BeeApp
186 } 192 }
187 193
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!