diff --git a/main.go b/main.go index d9afcef..0d28d9f 100644 --- a/main.go +++ b/main.go @@ -42,26 +42,33 @@ func Routes(s service.Service, t template.Template) *chi.Mux { } func main() { + log.Println("Loading configurations...") config, err := config.New() if err != nil { log.Fatal(err) } + log.Println("Configurations loaded!") + log.Println("Starting query service...") service, err := service.New(*config) if err != nil { log.Fatal(err) } defer service.TSClient.Close() + log.Println("Query service connected to", fmt.Sprintf("%s:%d!", config.ServerTS.IP, config.ServerTS.PortQuery)) + log.Println("Loading templates...") templates, err := gui.LoadTemplates() if err != nil { log.Fatal(err) } + log.Println("All templates loaded!") router := Routes(*service, *templates) router.Get("/static/*", func(w http.ResponseWriter, r *http.Request) { http.StripPrefix("/static", http.FileServer(http.Dir("./static"))).ServeHTTP(w, r) }) + log.Println("Starting the web server locally on port", config.ServerWeb.Port) log.Fatal("Handler: ", http.ListenAndServe(fmt.Sprintf(":%d", config.ServerWeb.Port), router)) }