Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
math_tutor_dev
public_math_tutor
Commits
20d236c1
Commit
20d236c1
authored
Feb 03, 2026
by
Kantz
Browse files
.env für BackendURL hinzugefügt
parent
711e611e
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/frontend/.env-Example
0 → 100644
View file @
20d236c1
math-tutor/frontend/src/pages/App.tsx
View file @
20d236c1
...
...
@@ -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
"
}),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment