You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
768 B
41 lines
768 B
package main
|
|
|
|
import (
|
|
"GoClouds/core/comm"
|
|
"GoClouds/webs/sys/app"
|
|
"GoClouds/webs/sys/controller"
|
|
"github.com/mgr9525/go-cloud"
|
|
"html/template"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
/*ymlpath:=""
|
|
if len(os.Args)>1 {
|
|
ymlpath=os.Args[1]
|
|
}*/
|
|
|
|
gocloud.RunApp("", constomRoute, customFun)
|
|
}
|
|
|
|
func customFun() []template.FuncMap {
|
|
println("constomFun")
|
|
err := comm.InitDb()
|
|
if err != nil {
|
|
println("db err:" + err.Error())
|
|
os.Exit(1)
|
|
}
|
|
gocloud.GetCustomConf("", app.Conf)
|
|
return []template.FuncMap{map[string]interface{}{
|
|
"AppName": func() string {
|
|
return "GoCloud"
|
|
},
|
|
"AppVer": func() string {
|
|
return "1.0.0"
|
|
},
|
|
}}
|
|
}
|
|
func constomRoute() {
|
|
gocloud.RegController(new(controller.CommController))
|
|
gocloud.RegController(new(controller.UserController))
|
|
}
|