Files
gatus/main.go
T

29 lines
547 B
Go
Raw Normal View History

2019-09-04 19:37:13 -04:00
package main
import (
"os"
2020-10-30 21:00:03 +05:30
"github.com/TwinProduction/gatus/config"
2020-12-29 20:22:17 -05:00
"github.com/TwinProduction/gatus/controller"
2020-10-30 21:00:03 +05:30
"github.com/TwinProduction/gatus/watchdog"
2019-09-04 19:37:13 -04:00
)
func main() {
cfg := loadConfiguration()
go watchdog.Monitor(cfg)
2020-12-29 20:22:17 -05:00
controller.Handle()
}
func loadConfiguration() *config.Config {
var err error
customConfigFile := os.Getenv("GATUS_CONFIG_FILE")
if len(customConfigFile) > 0 {
err = config.Load(customConfigFile)
} else {
err = config.LoadDefaultConfiguration()
}
if err != nil {
panic(err)
}
return config.Get()
}