diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-24 01:10:34 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-24 01:10:34 -0400 |
commit | 3071ff12cf2bd06b18596275771195ca711bc024 (patch) | |
tree | 682501f9238ef9cbc8581779a26d752556afc3b4 /config/config.go | |
parent | a35496c9223018471b51aecac9bf4e3a1387883c (diff) | |
parent | be98920271e9f1a8becb1dbf91be721380a81bb3 (diff) | |
download | donetick-3071ff12cf2bd06b18596275771195ca711bc024.tar.gz donetick-3071ff12cf2bd06b18596275771195ca711bc024.tar.bz2 donetick-3071ff12cf2bd06b18596275771195ca711bc024.zip |
Merge branch 'dev'
Diffstat (limited to 'config/config.go')
-rw-r--r-- | config/config.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/config/config.go b/config/config.go index fc21b49..52ed1db 100644 --- a/config/config.go +++ b/config/config.go @@ -48,6 +48,7 @@ type ServerConfig struct { ReadTimeout time.Duration `mapstructure:"read_timeout" yaml:"read_timeout"` WriteTimeout time.Duration `mapstructure:"write_timeout" yaml:"write_timeout"` CorsAllowOrigins []string `mapstructure:"cors_allow_origins" yaml:"cors_allow_origins"` + ServeFrontend bool `mapstructure:"serve_frontend" yaml:"serve_frontend"` } type SchedulerConfig struct { @@ -101,15 +102,17 @@ func configEnvironmentOverrides(Config *Config) { func LoadConfig() *Config { // set the config name based on the environment: - if os.Getenv("CA_ENV") == "local" { + if os.Getenv("DT_ENV") == "local" { viper.SetConfigName("local") - } else if os.Getenv("CA_ENV") == "prod" { + } else if os.Getenv("DT_ENV") == "prod" { viper.SetConfigName("prod") + } else if os.Getenv("DT_ENV") == "selfhosted" { + viper.SetConfigName("selfhosted") } else { viper.SetConfigName("local") } // get logger and log the current environment: - fmt.Printf("--ConfigLoad config for environment: %s ", os.Getenv("CA_ENV")) + fmt.Printf("--ConfigLoad config for environment: %s ", os.Getenv("DT_ENV")) viper.AddConfigPath("./config") viper.SetConfigType("yaml") |