feat: make chat the public starting surface
CI / test (push) Successful in 21s
CI / test (pull_request) Successful in 19s

This commit is contained in:
m
2026-08-21 08:56:20 +03:00
parent 39a27102c9
commit 7eb2f5f313
6 changed files with 93 additions and 7 deletions
+17 -1
View File
@@ -112,7 +112,12 @@ func (g *gateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
if r.URL.Path == "/" {
w.Header().Set("Cache-Control", "no-store")
serveEmbeddedHTML(w, "chat.html")
return
}
if r.URL.Path == "/admin" {
serveEmbeddedHTML(w, "index.html")
return
}
if r.URL.Path == "/chat" {
r = r.Clone(r.Context())
@@ -122,6 +127,17 @@ func (g *gateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {
g.static.ServeHTTP(w, r)
}
func serveEmbeddedHTML(w http.ResponseWriter, name string) {
body, err := staticFiles.ReadFile("static/" + name)
if err != nil {
http.Error(w, "page unavailable", http.StatusNotFound)
return
}
w.Header().Set("Cache-Control", "no-store")
w.Header().Set("Content-Type", "text/html; charset=utf-8")
_, _ = w.Write(body)
}
type browserAdvisoryRequest struct {
Message string `json:"message"`
SessionID string `json:"session_id"`