fix: use relative API paths for /stt reverse proxy

/stt 하위 경로에서 동작하도록 fetch 경로를 절대경로(/api, /healthz)에서
상대경로(api, healthz)로 변경합니다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-09 19:26:23 +09:00
parent 3a0e336518
commit 63dcae8bdb

View File

@@ -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("삭제 완료");