diff --git a/src/cmd/server/handler/testdata/dark.css b/src/cmd/server/handler/public/dark.css similarity index 100% rename from src/cmd/server/handler/testdata/dark.css rename to src/cmd/server/handler/public/dark.css diff --git a/src/cmd/server/handler/testdata/index.tmpl b/src/cmd/server/handler/public/index.tmpl similarity index 100% rename from src/cmd/server/handler/testdata/index.tmpl rename to src/cmd/server/handler/public/index.tmpl diff --git a/src/cmd/server/handler/ui.go b/src/cmd/server/handler/ui.go index 35fcfac..5e70b40 100644 --- a/src/cmd/server/handler/ui.go +++ b/src/cmd/server/handler/ui.go @@ -17,17 +17,17 @@ import ( _ "embed" ) -//go:embed testdata/index.tmpl +//go:embed public/index.tmpl var embeddedIndexTMPL string -//go:embed testdata/* +//go:embed public/* var embeddedDir embed.FS var dir = func() string { if v := os.Getenv("UI_D"); v != "" { return v } - return "./src/cmd/server/handler/testdata" + return "./src/cmd/server/handler/public" }() func (h Handler) ui(w http.ResponseWriter, r *http.Request) error { @@ -37,7 +37,7 @@ func (h Handler) ui(w http.ResponseWriter, r *http.Request) error { w.Header().Set("Cache-Control", "max-age=2592000") fs := http.FileServer(http.FS(embeddedDir)) - r.URL.Path = fmt.Sprintf("/testdata/%s", strings.TrimPrefix(r.URL.Path, "/experimental/ui")) + r.URL.Path = fmt.Sprintf("/public/%s", strings.TrimPrefix(r.URL.Path, "/experimental/ui")) fs.ServeHTTP(w, r) return nil }