feat(ui): proxy audio generation and streaming through SvelteKit, fix hardcoded scraper URL in AudioPlayer

This commit is contained in:
Admin
2026-03-02 22:00:13 +05:00
parent e4c4f8de66
commit f95ad3ed29
2 changed files with 97 additions and 5 deletions

View File

@@ -55,11 +55,11 @@
status = 'generating';
errorMsg = '';
try {
const res = await fetch(`http://localhost:8080/ui/audio/${slug}/${chapter}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ voice, speed })
});
const res = await fetch(`/api/audio/${slug}/${chapter}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ voice, speed })
});
if (!res.ok) throw new Error(`Generation failed: ${res.status}`);
// After generation, fetch the presigned URL
await loadAudio();