music: document the full /api/music/* contract at the source of truth

The proxy is an opaque catch-all, so the endpoint surface wasn't perceivable from
the platform side. Add a contract header (all routes + params + SSE/response
shapes) atop the sidecar fetch handler where the routes are defined, and point
the proxy router at it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-26 03:23:09 +00:00
co-authored by Claude Opus 4.8
parent 1192aa23fc
commit fe6f1fc095
2 changed files with 28 additions and 2 deletions
+6 -2
View File
@@ -3,8 +3,12 @@ import { getMusicServerUrl } from './sidecar-server';
// Thin reverse-proxy for /api/music/*. Auth is handled upstream by userMiddleware (this router mounts
// under the protected /api tree, so the media `?token=` path works). Everything else — path resolution,
// byte-range streaming, ffprobe duration — is done by the officer-music sidecar's audio server. We only
// forward the subpath + query + Range and stream the response back.
// byte-range streaming, ffprobe duration, indexing — is done by the officer-music sidecar's audio
// server. We only forward the subpath + query + Range and stream the response back.
//
// This is a catch-all, so it lists no routes: the full /api/music/* HTTP contract (stream, manifest,
// meta, cover, reindex, reindex/stream + their SSE/response shapes) is documented at the top of the
// sidecar's fetch handler — src/servers/sidecar/music/index.ts.
export const musicRouter = createRouter();