support restful router
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 | ... | ... |
-
Please register or sign in to post a comment