Commit b9c8c08c authored by Abel's avatar Abel

Add host env feature.

parent c5118e95
......@@ -134,9 +134,16 @@ func init() {
if err != nil {
panic(err)
}
appConfigPath = filepath.Join(workPath, "conf", "app.conf")
var confFile = "app."
var hostEnv = os.Getenv("BEEGO_ENV")
if (len(hostEnv) != 0){
confFile += hostEnv+".conf"
}else{
confFile += "conf"
}
appConfigPath = filepath.Join(workPath, "conf", confFile)
if !utils.FileExists(appConfigPath) {
appConfigPath = filepath.Join(AppPath, "conf", "app.conf")
appConfigPath = filepath.Join(AppPath, "conf", confFile)
if !utils.FileExists(appConfigPath) {
AppConfig = &beegoAppConfig{innerConfig: config.NewFakeConfig()}
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment