package api import ( "encoding/json" "net/http" ) // HandleStatus returns the current stream status as JSON. // GET /api/status func (a *App) HandleStatus(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet { http.Error(w, "method not allowed", http.StatusMethodNotAllowed) return } a.mu.RLock() status := a.Status a.mu.RUnlock() w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(status) }