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:
@@ -499,7 +499,7 @@
|
|||||||
|
|
||||||
async function checkHealth() {
|
async function checkHealth() {
|
||||||
try {
|
try {
|
||||||
const r = await fetch("/healthz");
|
const r = await fetch("healthz");
|
||||||
if (!r.ok) throw new Error("not ok");
|
if (!r.ok) throw new Error("not ok");
|
||||||
healthEl.textContent = "서버 정상";
|
healthEl.textContent = "서버 정상";
|
||||||
} catch {
|
} catch {
|
||||||
@@ -575,7 +575,7 @@
|
|||||||
if (!currentJobId) return;
|
if (!currentJobId) return;
|
||||||
try {
|
try {
|
||||||
setStatus("취소 요청…");
|
setStatus("취소 요청…");
|
||||||
await fetch(`/api/jobs/${encodeURIComponent(currentJobId)}/cancel`, { method: "POST" });
|
await fetch(`api/jobs/${encodeURIComponent(currentJobId)}/cancel`, { method: "POST" });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError(String(e?.message || e));
|
setError(String(e?.message || e));
|
||||||
}
|
}
|
||||||
@@ -590,7 +590,7 @@
|
|||||||
|
|
||||||
async function pollJobOnce() {
|
async function pollJobOnce() {
|
||||||
if (!currentJobId) return;
|
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(() => ({}));
|
const body = await r.json().catch(() => ({}));
|
||||||
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
||||||
|
|
||||||
@@ -680,7 +680,7 @@
|
|||||||
fd.append("beam_size", $("beam").value);
|
fd.append("beam_size", $("beam").value);
|
||||||
|
|
||||||
uploadController = new AbortController();
|
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(() => ({}));
|
const body = await r.json().catch(() => ({}));
|
||||||
if (!r.ok) {
|
if (!r.ok) {
|
||||||
throw new Error(body?.detail || `HTTP ${r.status}`);
|
throw new Error(body?.detail || `HTTP ${r.status}`);
|
||||||
@@ -761,7 +761,7 @@
|
|||||||
if (q) params.set("q", q);
|
if (q) params.set("q", q);
|
||||||
if (author) params.set("author_id", author);
|
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(() => ({}));
|
const body = await r.json().catch(() => ({}));
|
||||||
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
||||||
|
|
||||||
@@ -800,7 +800,7 @@
|
|||||||
adminSaveEl.disabled = true;
|
adminSaveEl.disabled = true;
|
||||||
adminDeleteEl.disabled = true;
|
adminDeleteEl.disabled = true;
|
||||||
try {
|
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(() => ({}));
|
const body = await r.json().catch(() => ({}));
|
||||||
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
||||||
|
|
||||||
@@ -824,7 +824,7 @@
|
|||||||
status: adminEditStatusEl.value,
|
status: adminEditStatusEl.value,
|
||||||
text: adminEditTextEl.value || "",
|
text: adminEditTextEl.value || "",
|
||||||
};
|
};
|
||||||
const r = await fetch(`/api/records/${encodeURIComponent(String(selectedRecordId))}`, {
|
const r = await fetch(`api/records/${encodeURIComponent(String(selectedRecordId))}`, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
@@ -845,7 +845,7 @@
|
|||||||
if (!confirm(`레코드 #${rid} 를 삭제할까요?`)) return;
|
if (!confirm(`레코드 #${rid} 를 삭제할까요?`)) return;
|
||||||
adminSetStatus("삭제 중…");
|
adminSetStatus("삭제 중…");
|
||||||
try {
|
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(() => ({}));
|
const body = await r.json().catch(() => ({}));
|
||||||
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
if (!r.ok) throw new Error(body?.detail || `HTTP ${r.status}`);
|
||||||
adminSetStatus("삭제 완료");
|
adminSetStatus("삭제 완료");
|
||||||
|
|||||||
Reference in New Issue
Block a user