diff --git a/README.md b/README.md index 4b4db5a1..6964e98f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ Live example: https://status.twinnation.org/ ## Usage +By default, the configuration file is expected to be at `config/config.yaml`. + +You can specify a custom path by setting the `GATUS_CONFIG_FILE` environment variable. + ```yaml metrics: true # Whether to expose metrics at /metrics services: diff --git a/main.go b/main.go index 1d5db173..4fa8a725 100644 --- a/main.go +++ b/main.go @@ -25,10 +25,10 @@ func main() { } func loadConfiguration() *config.Config { - args := os.Args var err error - if len(args) == 2 { - err = config.Load(args[1]) + customConfigFile := os.Getenv("GATUS_CONFIG_FILE") + if len(customConfigFile) > 0 { + err = config.Load(customConfigFile) } else { err = config.LoadDefaultConfiguration() }