diff --git a/main.go b/main.go index 7779175..ad1896e 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "html/template" "log" "net/http" + "path/filepath" "github.com/go-chi/chi/v5" ) @@ -26,15 +27,15 @@ func executeTemplate(w http.ResponseWriter, filepath string) { } func homeHandler(w http.ResponseWriter, r *http.Request) { - path := "templates/home.gohtml" + path := filepath.Join("templates", "home.gohtml") executeTemplate(w, path) } func contactHandler(w http.ResponseWriter, r *http.Request) { - path := "templates/contact.gohtml" + path := filepath.Join("templates", "contact.gohtml") executeTemplate(w, path) } func faqHandler(w http.ResponseWriter, r *http.Request) { - path := "templates/faq.gohtml" + path := filepath.Join("templates", "faq.gohtml") executeTemplate(w, path) }