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";
import type { ChatMessage } from "../components/Chat/MessageList";
import type { RetrievedDoc } from "../components/Retrieval/DocPanel";
const backendUrl = import.meta.env.VITE_BACKEND_URL || "http://localhost:8000";
const initialMessages: ChatMessage[] = [];
type ArchivedChatSummary = {
......@@ -66,7 +68,7 @@ export default function App() {
setRetrievalLoading(true);
setRetrievalError(null);
const retrievalRequest = fetch("http://localhost:8000/api/retrieval/query", {
const retrievalRequest = fetch(`${backendUrl}/api/retrieval/query`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
......@@ -85,7 +87,7 @@ export default function App() {
setSections(payload.sections || []);
});
const response = await fetch("http://localhost:8000/api/chat", {
const response = await fetch(`${backendUrl}/api/chat`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
......@@ -151,7 +153,7 @@ export default function App() {
setArchiveError(null);
try {
const response = await fetch(
"http://localhost:8000/api/chat/archives?limit=50"
`${backendUrl}/api/chat/archives?limit=50`
);
if (!response.ok) {
throw new Error(`Archive list failed: ${response.status}`);
......@@ -175,7 +177,7 @@ export default function App() {
setArchiveError(null);
try {
const response = await fetch(
`http://localhost:8000/api/chat/archive/${targetId}`
`${backendUrl}/api/chat/archive/${targetId}`
);
if (!response.ok) {
throw new Error(`Archive load failed: ${response.status}`);
......@@ -194,7 +196,7 @@ export default function App() {
if (messages.length) {
setIsArchiving(true);
try {
await fetch("http://localhost:8000/api/chat/archive", {
await fetch(`${backendUrl}/api/chat/archive`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
......@@ -229,7 +231,7 @@ export default function App() {
});
try {
const response = await fetch("http://localhost:8000/api/canvas/save", {
const response = await fetch(`${backendUrl}/api/canvas/save`, {
method: "POST",
headers: { "Content-Type": "application/json" },
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