Embed UI in binary (fix 404 when web/ missing from WorkingDirectory). Document logs and troubleshooting.
Made-with: Cursor
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user