Embed UI in binary (fix 404 when web/ missing from WorkingDirectory). Document logs and troubleshooting.

Made-with: Cursor
This commit is contained in:
Луценко Андрей Анатольевич
2026-04-10 12:28:53 +10:00
parent e25e068515
commit 659b76f1cf
4 changed files with 24 additions and 2 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"time"
"nettopo-go/internal/scans"
"nettopo-go/internal/webui"
)
type Handler struct {
@@ -54,7 +55,7 @@ func NewHandler(store scans.Store, run *scans.Runner) *Handler {
func (h *Handler) Routes() http.Handler {
mux := http.NewServeMux()
webFS := http.FileServer(http.Dir("web"))
webFS := http.FileServer(http.FS(webui.FS))
mux.Handle("GET /", webFS)
mux.Handle("GET /web/", http.StripPrefix("/web/", webFS))
mux.HandleFunc("GET /health", h.health)