1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-04 09:50:18 +00:00

support autorouter

This commit is contained in:
astaxie
2013-07-27 10:25:14 +08:00
parent fbde7df487
commit f7e7fab6f2
2 changed files with 81 additions and 1 deletions

View File

@ -138,6 +138,11 @@ func (app *App) Router(path string, c ControllerInterface, mappingMethods ...str
return app
}
func (app *App) AutoRouter(c ControllerInterface) *App {
app.Handlers.AddAuto(c)
return app
}
func (app *App) Filter(filter http.HandlerFunc) *App {
app.Handlers.Filter(filter)
return app
@ -192,6 +197,11 @@ func RESTRouter(rootpath string, c ControllerInterface) *App {
return BeeApp
}
func AutoRouter(c ControllerInterface) *App {
BeeApp.AutoRouter(c)
return BeeApp
}
func RouterHandler(path string, c http.Handler) *App {
BeeApp.Handlers.AddHandler(path, c)
return BeeApp