From 1c7776be3bd131e81f8a4ab833ca3df88b9ce288 Mon Sep 17 00:00:00 2001 From: Locria Cyber <74560659+iacore@users.noreply.github.com> Date: Sun, 1 Oct 2023 08:49:02 +0000 Subject: [PATCH] Load config on page load --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index f5ea498..89b078f 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,13 @@ func rootPage(w http.ResponseWriter, r *http.Request) { return } + config_new, err := core.LoadConfig() + if err != nil { + log.Println("[WARN] failed to load config:", err) + } else { + config = config_new + } + // get service status' var data []scanner.ServiceStatus for _, v := range config.Service {