refactor(web): proxy TTS through /api/setup/tts/speak (refs #451)

Point soundtouch-web's TTS proxy at the new canonical /api/setup/tts/speak path
(request URL and doc comment). No behavior change; the legacy path still works.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tobias Gesellchen
2026-06-06 20:57:54 +02:00
co-authored by Claude Opus 4.8
parent dbdc75627a
commit 3d5add3a07
+2 -2
View File
@@ -38,7 +38,7 @@ func hostOnly(raw string) string {
// HandleAPISpeakText synthesizes and plays text on a device. The Web UI talks
// to speakers directly for most controls, but TTS synthesis (Google Cloud) and
// the Bose app_key live in the AfterTouch service, so this proxies to the
// service's /setup/tts/speak endpoint, targeting the device by its IP/host.
// service's /api/setup/tts/speak endpoint, targeting the device by its IP/host.
func (app *WebApp) HandleAPISpeakText(w http.ResponseWriter, r *http.Request) {
deviceID := chi.URLParam(r, "id")
@@ -118,7 +118,7 @@ func (app *WebApp) HandleAPISpeakText(w http.ResponseWriter, r *http.Request) {
return
}
upstream, err := http.NewRequestWithContext(r.Context(), http.MethodPost, serviceURL+"/setup/tts/speak", bytes.NewReader(body))
upstream, err := http.NewRequestWithContext(r.Context(), http.MethodPost, serviceURL+"/api/setup/tts/speak", bytes.NewReader(body))
if err != nil {
app.sendError(w, "Failed to build TTS request", http.StatusInternalServerError)
return