diff --git a/cmd/http/main.go b/cmd/http/main.go index 34e2ed0..a0c1945 100644 --- a/cmd/http/main.go +++ b/cmd/http/main.go @@ -6,6 +6,7 @@ import ( "flag" "fmt" "io" + "io/fs" "log" "maps" "net/http" @@ -29,9 +30,13 @@ import ( var _staticFileDir embed.FS var publicHandler = func() http.Handler { if os.Getenv("DEBUG") != "" { - return http.FileServer(http.Dir("./http")) + return http.FileServer(http.Dir("./http/public")) } - return http.FileServer(http.FS(_staticFileDir)) + sub, err := fs.Sub(_staticFileDir, "public") + if err != nil { + panic(err) + } + return http.FileServer(http.FS(sub)) }() func Main() { diff --git a/cmd/http/public/index.html b/cmd/http/public/index.html index 1684864..7da7169 100644 --- a/cmd/http/public/index.html +++ b/cmd/http/public/index.html @@ -16,8 +16,8 @@

Moolah2 Hub

diff --git a/cmd/http/public/transactions.html b/cmd/http/public/transactions.html index 89f1d07..6a25bf1 100644 --- a/cmd/http/public/transactions.html +++ b/cmd/http/public/transactions.html @@ -17,7 +17,7 @@ } function callback(responseBody, responseStatus) { } - var f = String(window.location).split("/public/transactions.html")[1] + var f = String(window.location).split("/transactions.html")[1] if (!f) { f = "/moolah.dat" }