add channel for router to communicate config changes out

This commit is contained in:
Joel Wetzell
2026-03-12 17:33:41 -05:00
parent 818ddc18f4
commit ca6aebadef
2 changed files with 7 additions and 4 deletions

1
api.go
View File

@@ -106,6 +106,7 @@ func (r *Router) handleConfigHTTP(w http.ResponseWriter, req *http.Request) {
}
w.Header().Set("Access-Control-Allow-Origin", "*")
w.WriteHeader(http.StatusOK)
r.ConfigChange <- newConfig
case http.MethodOptions:
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, PUT, OPTIONS")