Allow configuration overriding with environment variables

This commit is contained in:
2020-05-20 19:08:53 +02:00
parent a6ffc639a1
commit 389eb3885b
5 changed files with 39 additions and 23 deletions

View File

@ -85,6 +85,10 @@ func main() {
os.Exit(0)
}
if err := config.WithEnvironment(conf); err != nil {
log.Fatalf("%+v", errors.Wrap(err, "could not override config with environment"))
}
// Create service container
ctn, err := getServiceContainer(conf)
if err != nil {
@ -109,4 +113,4 @@ func main() {
if err := http.ListenAndServe(conf.HTTP.Address, r); err != nil {
log.Fatalf("%+v", errors.Wrapf(err, "could not listen on '%s'", conf.HTTP.Address))
}
}
}