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