From 478100200dff8400a6e47502fa4a6db035fd6532 Mon Sep 17 00:00:00 2001 From: blackhao <13851610112@163.com> Date: Wed, 10 Dec 2025 21:07:17 -0600 Subject: fix: use relative API paths for production deployment --- frontend/src/components/Sidebar.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'frontend/src/components/Sidebar.tsx') diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 17050aa..61a5f02 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -295,7 +295,7 @@ const Sidebar: React.FC = ({ isOpen, onToggle, onInteract }) => { : ''; try { - const response = await fetch('http://localhost:8000/api/run_node_stream', { + const response = await fetch('/api/run_node_stream', { method: 'POST', headers: { 'Content-Type': 'application/json', ...getAuthHeader() }, body: JSON.stringify({ @@ -386,7 +386,7 @@ const Sidebar: React.FC = ({ isOpen, onToggle, onInteract }) => { setShowSummaryModal(false); try { - const res = await fetch('http://localhost:8000/api/summarize', { + const res = await fetch('/api/summarize', { method: 'POST', headers: { 'Content-Type': 'application/json', ...getAuthHeader() }, body: JSON.stringify({ @@ -412,7 +412,7 @@ const Sidebar: React.FC = ({ isOpen, onToggle, onInteract }) => { // Auto-generate title using gpt-5-nano const generateTitle = async (nodeId: string, userPrompt: string, response: string) => { try { - const res = await fetch('http://localhost:8000/api/generate_title', { + const res = await fetch('/api/generate_title', { method: 'POST', headers: { 'Content-Type': 'application/json', ...getAuthHeader() }, body: JSON.stringify({ user_prompt: userPrompt, response }) @@ -489,7 +489,7 @@ const Sidebar: React.FC = ({ isOpen, onToggle, onInteract }) => { const messages = computeMergedMessages(selectedNode.id, orderedSelectedIds, 'trace_order'); const content = messages.map(m => `${m.role}: ${m.content}`).join('\n\n'); - const res = await fetch('http://localhost:8000/api/summarize', { + const res = await fetch('/api/summarize', { method: 'POST', headers: { 'Content-Type': 'application/json', ...getAuthHeader() }, body: JSON.stringify({ @@ -1003,7 +1003,7 @@ const Sidebar: React.FC = ({ isOpen, onToggle, onInteract }) => { const scopes = [`${projectPath}/quick_chat_temp`]; // Call LLM API with current messages as context - const response = await fetch('http://localhost:8000/api/run_node_stream', { + const response = await fetch('/api/run_node_stream', { method: 'POST', headers: { 'Content-Type': 'application/json', ...getAuthHeader() }, body: JSON.stringify({ -- cgit v1.2.3