From 727b4fdea6b230f8b7ba48a0c62585d354118757 Mon Sep 17 00:00:00 2001 From: bel Date: Sun, 30 Nov 2025 08:40:15 -0700 Subject: [PATCH] from testdata to public for .html --- src/cmd/server/handler/{testdata => public}/dark.css | 0 src/cmd/server/handler/{testdata => public}/index.tmpl | 0 src/cmd/server/handler/ui.go | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/cmd/server/handler/{testdata => public}/dark.css (100%) rename src/cmd/server/handler/{testdata => public}/index.tmpl (100%) 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 }