From 036d6f604cdfcc5ca6970caba781f531ac32efa8 Mon Sep 17 00:00:00 2001 From: Hendrik Schlehlein Date: Sun, 3 Feb 2019 21:00:14 +0100 Subject: [PATCH] added startup messages --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) 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)) }