Skip to content

Commit

Permalink
env var config overrides using FABIO_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
doublerebel committed Mar 2, 2016
1 parent 5a05baa commit 15d6bb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func FromViper(v *viper.Viper) (cfg *Config, err error) {
v.SetDefault("", Default)
v.SetDefault("Listen", defaultListen)

v.SetEnvPrefix("FABIO")
v.SetEnvKeyReplacer(strings.NewReplacer(".","_"))
v.AutomaticEnv()

v.Unmarshal(cfg)

if cfg.Metrics[0].Target == "graphite" {
Expand Down

0 comments on commit 15d6bb5

Please sign in to comment.