Exemple #1
0
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{})
}
Exemple #2
0
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{})
}
Exemple #3
0
func init() {
	// beego.Router("/", &controllers.MainController{})
	beego.Include(&controllers.MainController{})
	beego.AddFuncMap("ToString", func(b []byte) string {
		return goutils.ToString(b)
	})
}
Exemple #4
0
func init() {
	//首页
	beego.Router("/", &controllers.MainController{})

	//api
	beego.Include(&controllers.CMSController{})
}
Exemple #5
0
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{})
}
Exemple #6
0
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{})
}
Exemple #7
0
func main() {
	ns := beego.NewNamespace("/js",
		beego.NSInclude(&controllers.NewsController{}),
	)
	beego.AddNamespace(ns)
	app := beego.Include(&controllers.NewsVController{})
	app.Run()
}
Exemple #8
0
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)
}
Exemple #9
0
func init() {
	// beego.Router("/", &controllers.MainController{})
	beego.Include(&controllers.MainController{})
}
Exemple #10
0
func main() {
	app := beego.Include(&controllers.FileServerController{})
	beego.ErrorController(&controllers.ErrorController{})
	// beego.InsertFilter("/*", beego.BeforeRouter, CheckLogin)
	app.Run()
}
Exemple #11
0
func init() {
	beego.Get("/meta/healthcheck", func(ctx *context.Context) {
		ctx.ResponseWriter.WriteHeader(200)
	})
	beego.Include(&controllers.MagicController{})
}
Exemple #12
0
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")
}
Exemple #13
0
func init() {
	beego.Include(&controllers.MasterController{})
	beego.SetStaticPath("/static", "static")
	beego.SetStaticPath("/doc", "static/doc")
}
Exemple #14
0
func init() {
	beego.Include(
		// front index
		&index.IndexController{},
	)
}
Exemple #15
0
func init() {
	beego.Router("/", &controllers.DefaultController{})
	beego.Router("/test", &controllers.TestController{})
	beego.Include(&controllers.UserController{})
}