func init() { beego.Router("/", &controllers.MainController{}) //method 首字母需要大写 beego.Router("/login", &controllers.UserController{}, "get:Login") beego.Router("/login", &controllers.UserController{}, "post:Dologin") beego.Router("/reg", &controllers.UserController{}, "get:Reg") beego.Router("/logout", &controllers.UserController{}, "get:Logout") beego.Router("/forget-password", &controllers.UserController{}, "get:Forget") //beego.AutoRouter(&controllers.UserController{}) beego.Include(&controllers.CMSController{}) beego.Include(&controllers.ExamplesController{}) }
func init() { // beego.Router("/", &controllers.MainController{}) // beego.Router("/addUser", &controllers.MainController{}, "get:AddUser") // var FilterUser = func(ctx *context.Context) { // _, ok := ctx.Input.Session("uid").(int) // fmt.Println(ctx.Request.RequestURI) // if !ok && ctx.Request.RequestURI != "/addUser" { // ctx.Redirect(302, "/addUser") // } // } // beego.InsertFilter("/*", beego.BeforeRouter, FilterUser) beego.Include(&controllers.MainController{}) beego.Include(&controllers.HomeController{}) }
func init() { // beego.Router("/", &controllers.MainController{}) beego.Include(&controllers.MainController{}) beego.AddFuncMap("ToString", func(b []byte) string { return goutils.ToString(b) }) }
func init() { //首页 beego.Router("/", &controllers.MainController{}) //api beego.Include(&controllers.CMSController{}) }
func init() { imageWS := &controllers.ImageWS{} beego.Handler("/imagews.asmx", imageWS) logoWS := &controllers.LogoWS{} beego.Handler("/logows.asmx", logoWS) imageHandler := &controllers.ImageHandler{} beego.Handler("/imagehandler.ashx", imageHandler) beego.Router("/", &controllers.ImageController{}) beego.Include(&controllers.WhitelistController{}) beego.Include(&controllers.ImageDeleteController{}) beego.Include(&controllers.ConfigController{}) beego.Include(&controllers.ChannelController{}) beego.Include(&controllers.ViewController{}) }
func init() { // RESTful beego.Router("/main", &controllers.MainController{}) // RESTful beego.Router("/rest", &controllers.RestfullController{}) // 关联函数路由 beego.Router("/api", &controllers.ApiController{}, "*:Json") // 自动匹配路由 beego.AutoRouter(&controllers.AutoController{}) //注解路由 beego.Include(&controllers.AnnotationController{}) //注解路由 beego.Include(&controllers.ConfigController{}) }
func main() { ns := beego.NewNamespace("/js", beego.NSInclude(&controllers.NewsController{}), ) beego.AddNamespace(ns) app := beego.Include(&controllers.NewsVController{}) app.Run() }
func init() { beego.Include(&controllers.MainController{}, &controllers.RegisterController{}) beego.ErrorController(&controllers.ErrorController{}) // ns := beego.NewNamespace("/", // // beego.NSRouter("/", &controllers.MainController{}), // beego.NSInclude(&controllers.MainController{}), // beego.NSInclude(&controllers.RegisterController{}), // ) // beego.AddNamespace(ns) }
func init() { // beego.Router("/", &controllers.MainController{}) beego.Include(&controllers.MainController{}) }
func main() { app := beego.Include(&controllers.FileServerController{}) beego.ErrorController(&controllers.ErrorController{}) // beego.InsertFilter("/*", beego.BeforeRouter, CheckLogin) app.Run() }
func init() { beego.Get("/meta/healthcheck", func(ctx *context.Context) { ctx.ResponseWriter.WriteHeader(200) }) beego.Include(&controllers.MagicController{}) }
func init() { // beego.Router("/", &controllers.MainController{}) beego.Include(&controllers.JudgeController{}, &controllers.LoginController{}, &controllers.RegistController{}, &controllers.PuzzleController{}, &controllers.UserController{}, &controllers.ListController{}) beego.ErrorController(&controllers.ErrorController{}) beego.SetStaticPath("public", "static") }
func init() { beego.Include(&controllers.MasterController{}) beego.SetStaticPath("/static", "static") beego.SetStaticPath("/doc", "static/doc") }
func init() { beego.Include( // front index &index.IndexController{}, ) }
func init() { beego.Router("/", &controllers.DefaultController{}) beego.Router("/test", &controllers.TestController{}) beego.Include(&controllers.UserController{}) }