示例#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{})
}
示例#2
0
文件: router.go 项目: lcbyz/Go
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{})
}
示例#3
0
文件: router.go 项目: shaalx/upload
func init() {
	// beego.Router("/", &controllers.MainController{})
	beego.Include(&controllers.MainController{})
	beego.AddFuncMap("ToString", func(b []byte) string {
		return goutils.ToString(b)
	})
}
示例#4
0
func init() {
	//首页
	beego.Router("/", &controllers.MainController{})

	//api
	beego.Include(&controllers.CMSController{})
}
示例#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{})
}
示例#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{})
}
示例#7
0
文件: main.go 项目: shaalx/news
func main() {
	ns := beego.NewNamespace("/js",
		beego.NSInclude(&controllers.NewsController{}),
	)
	beego.AddNamespace(ns)
	app := beego.Include(&controllers.NewsVController{})
	app.Run()
}
示例#8
0
文件: router.go 项目: shaalx/bbs
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)
}
示例#9
0
文件: router.go 项目: everfore/upload
func init() {
	// beego.Router("/", &controllers.MainController{})
	beego.Include(&controllers.MainController{})
}
示例#10
0
文件: main.go 项目: everfore/fservice
func main() {
	app := beego.Include(&controllers.FileServerController{})
	beego.ErrorController(&controllers.ErrorController{})
	// beego.InsertFilter("/*", beego.BeforeRouter, CheckLogin)
	app.Run()
}
示例#11
0
func init() {
	beego.Get("/meta/healthcheck", func(ctx *context.Context) {
		ctx.ResponseWriter.WriteHeader(200)
	})
	beego.Include(&controllers.MagicController{})
}
示例#12
0
文件: router.go 项目: shaalx/gooj
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")
}
示例#13
0
func init() {
	beego.Include(&controllers.MasterController{})
	beego.SetStaticPath("/static", "static")
	beego.SetStaticPath("/doc", "static/doc")
}
示例#14
0
func init() {
	beego.Include(
		// front index
		&index.IndexController{},
	)
}
示例#15
0
文件: router.go 项目: ckeyer/dbc
func init() {
	beego.Router("/", &controllers.DefaultController{})
	beego.Router("/test", &controllers.TestController{})
	beego.Include(&controllers.UserController{})
}