From 63dcae8bdb3c9fcf1cafe0e3bdbf7e0f2a13b5fc Mon Sep 17 00:00:00 2001 From: dsyoon Date: Mon, 9 Feb 2026 19:26:23 +0900 Subject: [PATCH] fix: use relative API paths for /stt reverse proxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /stt 하위 경로에서 동작하도록 fetch 경로를 절대경로(/api, /healthz)에서 상대경로(api, healthz)로 변경합니다. Co-authored-by: Cursor --- app/static/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/static/index.html b/app/static/index.html index 59fb500..7c725da 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -499,7 +499,7 @@ async function checkHealth() { try { - const r = await fetch("/healthz"); + const r = await fetch("healthz"); if (!r.ok) throw new Error("not ok"); healthEl.textContent = "서버 정상"; } catch { @@ -575,7 +575,7 @@ if (!currentJobId) return; try { setStatus("취소 요청…"); - await fetch(`/api/jobs/${encodeURIComponent(currentJobId)}/cancel`, { method: "POST" }); + await fetch(`api/jobs/${encodeURIComponent(currentJobId)}/cancel`, { method: "POST" }); } catch (e) { setError(String(e?.message || e)); } @@ -590,7 +590,7 @@ async function pollJobOnce() { if (!currentJobId) return; - const r = await fetch(`/api/jobs/${encodeURIComponent(currentJobId)}`); + const r = await fetch(`api/jobs/${encodeURIComponent(currentJobId)}`); const body = await r.json().catch(() => ({})); if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`); @@ -680,7 +680,7 @@ fd.append("beam_size", $("beam").value); uploadController = new AbortController(); - const r = await fetch("/api/jobs", { method: "POST", body: fd, signal: uploadController.signal }); + const r = await fetch("api/jobs", { method: "POST", body: fd, signal: uploadController.signal }); const body = await r.json().catch(() => ({})); if (!r.ok) { throw new Error(body?.detail || `HTTP ${r.status}`); @@ -761,7 +761,7 @@ if (q) params.set("q", q); if (author) params.set("author_id", author); - const r = await fetch(`/api/records?${params.toString()}`); + const r = await fetch(`api/records?${params.toString()}`); const body = await r.json().catch(() => ({})); if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`); @@ -800,7 +800,7 @@ adminSaveEl.disabled = true; adminDeleteEl.disabled = true; try { - const r = await fetch(`/api/records/${encodeURIComponent(String(selectedRecordId))}`); + const r = await fetch(`api/records/${encodeURIComponent(String(selectedRecordId))}`); const body = await r.json().catch(() => ({})); if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`); @@ -824,7 +824,7 @@ status: adminEditStatusEl.value, text: adminEditTextEl.value || "", }; - const r = await fetch(`/api/records/${encodeURIComponent(String(selectedRecordId))}`, { + const r = await fetch(`api/records/${encodeURIComponent(String(selectedRecordId))}`, { method: "PUT", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload), @@ -845,7 +845,7 @@ if (!confirm(`레코드 #${rid} 를 삭제할까요?`)) return; adminSetStatus("삭제 중…"); try { - const r = await fetch(`/api/records/${encodeURIComponent(String(rid))}`, { method: "DELETE" }); + const r = await fetch(`api/records/${encodeURIComponent(String(rid))}`, { method: "DELETE" }); const body = await r.json().catch(() => ({})); if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`); adminSetStatus("삭제 완료");