func main() { version := flag.Bool("version", false, "--version") flag.Parse() log.Info("version:v1.0.0") if *version { return } reload() web.Router("/", &IndexController{}, "Index") web.Run() }
func webRun() { web.Router("/tet", &TestController{}, "Index") web.Router("/tpl", &TestController{}, "TestTpl") web.AutoRouter("/", &TestController{}) ns := web.NewNamespace("/ns", web.NSRouter("/demo", &TestController{}, "TestTpl"), web.NSRouter("/demo1", &TestController{}, "Index"), web.NSNamespace("/demo2", web.NSRouter("/demo1", &TestController{}, "Index"), ), web.NSAutoRouter("/", &TestController{}), ) web.AddNamespace(ns) web.Run() }
func main() { version := flag.Bool("version", false, "--version") flag.Parse() log.Info("version:v1.0.0") if *version { return } sessions = make(map[string]*Session) reload() web.Router("/", &IndexController{}, "Index") web.HandleFunc("/reload", GOReload) web.Run() }