mirror of
https://github.com/astaxie/beego.git
synced 2024-11-16 13:20:54 +00:00
Merge pull request #849 from pabdavis/runmode-env
Support run mode set by environment variable
This commit is contained in:
commit
2823167848
@ -288,8 +288,11 @@ func init() {
|
||||
func ParseConfig() (err error) {
|
||||
AppConfig = newAppConfig(AppConfigProvider, AppConfigPath)
|
||||
|
||||
envRunMode := os.Getenv("BEEGO_RUNMODE")
|
||||
// set the runmode first
|
||||
if runmode := AppConfig.String("RunMode"); runmode != "" {
|
||||
if envRunMode != "" {
|
||||
RunMode = envRunMode
|
||||
} else if runmode := AppConfig.String("RunMode"); runmode != "" {
|
||||
RunMode = runmode
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user