diff --git a/main.go b/main.go index 101253e..99de5f0 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,8 @@ import ( "github.com/gorilla/mux" ) +var staticFolder = "./web/static/" + func main() { env.Load(".env") @@ -23,7 +25,6 @@ func main() { fmt.Println("upload folder for images not found: ", uploadFolder) fmt.Println("use fallback") uploadFolder = "./images" - } fmt.Println("upload folder for images: ", uploadFolder) @@ -37,17 +38,17 @@ func main() { r.HandleFunc("/api/delete", handlers.DeleteHandler).Methods("POST") r.HandleFunc("/manage", func(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, "manage.html") + http.ServeFile(w, r, staticFolder+"manage.html") }) r.HandleFunc("/api/info", handlers.InfoHandler).Methods("GET") r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, "index.html") + http.ServeFile(w, r, staticFolder+"index.html") }) // We add a route for the slideshow page specifically r.HandleFunc("/slideshow", func(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, "frame.html") + http.ServeFile(w, r, staticFolder+"frame.html") }) host := env.Host.GetValue() diff --git a/frame.html b/web/static/frame.html similarity index 100% rename from frame.html rename to web/static/frame.html diff --git a/index.html b/web/static/index.html similarity index 97% rename from index.html rename to web/static/index.html index 6d79a0a..ede0b13 100644 --- a/index.html +++ b/web/static/index.html @@ -3,7 +3,7 @@
-