package web import ( "context" _ "embed" "net/http" ) // atlasHTML is the Phase-A static hero visualization. Phase C replaces this // self-contained file with a Templ view hydrated from live CAD trace data // (assessor-loop ledger, session_log, Gitea run API, Flux events). // //go:embed static/cad-atlas.html var atlasHTML []byte // NewHandler serves the CAD Atlas. Root ("/") returns the static atlas; // /api/hello is a leftover template probe kept until Phase C wires real endpoints. func NewHandler() http.Handler { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/" { http.NotFound(w, r) return } w.Header().Set("Content-Type", "text/html; charset=utf-8") _, _ = w.Write(atlasHTML) }) mux.HandleFunc("/api/hello", func(w http.ResponseWriter, r *http.Request) { _ = Hello("world").Render(context.Background(), w) }) return mux }