From 65c171f2ea06faf31ce531b4113fcf1b7b155a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Urban?= Date: Wed, 11 Oct 2023 15:23:22 +0200 Subject: [PATCH] fix(backend): update public path --- backend/cmd/kubevoyage/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/cmd/kubevoyage/main.go b/backend/cmd/kubevoyage/main.go index 71f7bff..757c644 100644 --- a/backend/cmd/kubevoyage/main.go +++ b/backend/cmd/kubevoyage/main.go @@ -35,7 +35,7 @@ func setupServer(handle *handlers.Handler) http.Handler { handler := cors.Default().Handler(mux) // Serve static files - fs := http.FileServer(http.Dir("../public/")) // Adjust the path based on your directory structure + fs := http.FileServer(http.Dir("./public/")) // Adjust the path based on your directory structure mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { // Check if it's an API route first if isAPIRoute(r.URL.Path) { @@ -43,7 +43,7 @@ func setupServer(handle *handlers.Handler) http.Handler { return } - path := "../public" + r.URL.Path + path := "./public" + r.URL.Path absolutePath, err := filepath.Abs(path) if err != nil { fmt.Println("Error getting absolute path:", err) @@ -60,7 +60,7 @@ func setupServer(handle *handlers.Handler) http.Handler { log.Println(err) } // Otherwise, serve index.html - http.ServeFile(w, r, "../public/index.html") + http.ServeFile(w, r, "./public/index.html") }) mux.HandleFunc("/api/requests", func(w http.ResponseWriter, r *http.Request) {