1
0
forked from rosa/hakurei

cmd/pkgserver/ui_test: add DOM reporter

This commit is contained in:
Kat
2026-03-29 01:48:59 +11:00
parent 8cdfc0a819
commit 786def0c34
6 changed files with 169 additions and 1 deletions

View File

@@ -2,4 +2,26 @@
package main
import (
"embed"
"io/fs"
"net/http"
)
//go:generate tsc --outDir ui_test/static -p ui_test
//go:generate sass ui_test/lib/ui.scss ui_test/static/style.css
//go:generate cp ui_test/lib/ui.html ui_test/static/index.html
//go:embed ui_test/static
var _staticTest embed.FS
var staticTest = func() fs.FS {
if f, err := fs.Sub(_staticTest, "ui_test/static"); err != nil {
panic(err)
} else {
return f
}
}()
func testUIRoutes(mux *http.ServeMux) {
mux.Handle("GET /test/", http.StripPrefix("/test", http.FileServer(http.FS(staticTest))))
}