move html to static folder

This commit is contained in:
Adrian Zürcher
2026-01-16 07:57:33 +01:00
parent 4d9e0836e5
commit 45c400e7d3
5 changed files with 6 additions and 5 deletions

View File

@@ -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()