diff options
Diffstat (limited to 'golang/cmd')
-rw-r--r-- | golang/cmd/fatcatd/main.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/golang/cmd/fatcatd/main.go b/golang/cmd/fatcatd/main.go index c0668ed1..e98e0f79 100644 --- a/golang/cmd/fatcatd/main.go +++ b/golang/cmd/fatcatd/main.go @@ -7,6 +7,7 @@ import ( log "github.com/sirupsen/logrus" loads "github.com/go-openapi/loads" flags "github.com/jessevdk/go-flags" + "github.com/spf13/viper" "git.archive.org/bnewbold/fatcat/golang/restapi" "git.archive.org/bnewbold/fatcat/golang/restapi/operations" @@ -14,6 +15,18 @@ import ( func init() { + viper.SetEnvPrefix("FATCAT") + viper.AutomaticEnv() + viper.SetDefault("Port", 9411) + viper.SetDefault("Verbose", true) + + viper.SetConfigName("fatcatd.toml") + viper.AddConfigPath(".") + err := viper.ReadInConfig() + if err != nil { + log.Fatalf("Fatal error config file: %s \n", err) + } + // not default of stderr log.SetOutput(os.Stdout); |