Support config.yml (as an alternative to config.yaml)
@@ -5,6 +5,7 @@ import (
"github.com/TwinProduction/gatus/core"
"gopkg.in/yaml.v2"
"io/ioutil"
+ "os"
"time"
)
@@ -20,9 +21,16 @@ var (
func Get() *Config {
if config == nil {
cfg, err := readConfigurationFile("config.yaml")
+ if err != nil {
+ if os.IsNotExist(err) {
+ cfg, err = readConfigurationFile("config.yml")
if err != nil {
panic(err)
}
+ } else {
+ panic(err)
+ }
+ }
config = cfg
}
return config
