From ddee3adae0ac8af4dadbc97ec22f03d59b3dd262 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 30 Jan 2026 22:31:46 -0800 Subject: [PATCH] Rename API endpoints to /tendrils/api/*, detect SSE via Accept header Co-Authored-By: Claude Opus 4.5 --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 84ba2bd..8348a95 100644 --- a/main.go +++ b/main.go @@ -198,7 +198,7 @@ func main() { if *apiListen != "" { go func() { mux := http.NewServeMux() - mux.HandleFunc("/api/config", app.handleConfig) + mux.HandleFunc("/artmap/api/status", app.handleStatus) server := &http.Server{ Addr: *apiListen, Handler: mux, @@ -328,16 +328,16 @@ func (a *App) sendOutputs(outputs []remap.Output) { } } -type configResponse struct { +type statusResponse struct { Targets []config.Target `json:"targets"` Mappings []config.Mapping `json:"mappings"` Senders []senders.SenderInfo `json:"senders"` } -func (a *App) handleConfig(w http.ResponseWriter, r *http.Request) { +func (a *App) handleStatus(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") w.Header().Set("Server", "artmap") - resp := configResponse{ + resp := statusResponse{ Targets: a.cfg.Targets, Mappings: a.cfg.Mappings, Senders: a.senders.GetAll(),