Commit 20d236c1 authored by Kantz's avatar Kantz
Browse files

.env für BackendURL hinzugefügt

parent 711e611e
...@@ -6,6 +6,8 @@ import DocPanel from "../components/Retrieval/DocPanel"; ...@@ -6,6 +6,8 @@ import DocPanel from "../components/Retrieval/DocPanel";
import type { ChatMessage } from "../components/Chat/MessageList"; import type { ChatMessage } from "../components/Chat/MessageList";
import type { RetrievedDoc } from "../components/Retrieval/DocPanel"; import type { RetrievedDoc } from "../components/Retrieval/DocPanel";
const backendUrl = import.meta.env.VITE_BACKEND_URL || "http://localhost:8000";
const initialMessages: ChatMessage[] = []; const initialMessages: ChatMessage[] = [];
type ArchivedChatSummary = { type ArchivedChatSummary = {
...@@ -66,7 +68,7 @@ export default function App() { ...@@ -66,7 +68,7 @@ export default function App() {
setRetrievalLoading(true); setRetrievalLoading(true);
setRetrievalError(null); setRetrievalError(null);
const retrievalRequest = fetch("http://localhost:8000/api/retrieval/query", { const retrievalRequest = fetch(`${backendUrl}/api/retrieval/query`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ body: JSON.stringify({
...@@ -85,7 +87,7 @@ export default function App() { ...@@ -85,7 +87,7 @@ export default function App() {
setSections(payload.sections || []); setSections(payload.sections || []);
}); });
const response = await fetch("http://localhost:8000/api/chat", { const response = await fetch(`${backendUrl}/api/chat`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ body: JSON.stringify({
...@@ -151,7 +153,7 @@ export default function App() { ...@@ -151,7 +153,7 @@ export default function App() {
setArchiveError(null); setArchiveError(null);
try { try {
const response = await fetch( const response = await fetch(
"http://localhost:8000/api/chat/archives?limit=50" `${backendUrl}/api/chat/archives?limit=50`
); );
if (!response.ok) { if (!response.ok) {
throw new Error(`Archive list failed: ${response.status}`); throw new Error(`Archive list failed: ${response.status}`);
...@@ -175,7 +177,7 @@ export default function App() { ...@@ -175,7 +177,7 @@ export default function App() {
setArchiveError(null); setArchiveError(null);
try { try {
const response = await fetch( const response = await fetch(
`http://localhost:8000/api/chat/archive/${targetId}` `${backendUrl}/api/chat/archive/${targetId}`
); );
if (!response.ok) { if (!response.ok) {
throw new Error(`Archive load failed: ${response.status}`); throw new Error(`Archive load failed: ${response.status}`);
...@@ -194,7 +196,7 @@ export default function App() { ...@@ -194,7 +196,7 @@ export default function App() {
if (messages.length) { if (messages.length) {
setIsArchiving(true); setIsArchiving(true);
try { try {
await fetch("http://localhost:8000/api/chat/archive", { await fetch(`${backendUrl}/api/chat/archive`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ body: JSON.stringify({
...@@ -229,7 +231,7 @@ export default function App() { ...@@ -229,7 +231,7 @@ export default function App() {
}); });
try { try {
const response = await fetch("http://localhost:8000/api/canvas/save", { const response = await fetch(`${backendUrl}/api/canvas/save`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ data_url: dataUrl, filename_hint: "canvas" }), body: JSON.stringify({ data_url: dataUrl, filename_hint: "canvas" }),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment