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
a30701ae
Commit
a30701ae
authored
Feb 03, 2026
by
Kantz
Browse files
gegenrichtung auch angepasst
parent
20d236c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/config.py
View file @
a30701ae
...
...
@@ -48,6 +48,12 @@ def get_mathpix_settings() -> MathpixSettings:
app_key
=
os
.
getenv
(
"MATHPIX_APP_KEY"
)
)
def
get_frontend_url
()
->
str
:
url
=
os
.
getenv
(
"FRONTEND_URL"
)
if
not
url
:
raise
ValueError
(
"Missing FRONTEND_URL"
)
return
url
def
get_ollama_settings
()
->
OllamaSettings
:
return
OllamaSettings
(
base_url
=
os
.
getenv
(
"OLLAMA_URL"
,
"http://localhost:11434"
),
...
...
math-tutor/backend/app/main.py
View file @
a30701ae
...
...
@@ -3,6 +3,8 @@ from contextlib import asynccontextmanager
from
fastapi
import
FastAPI
from
fastapi.middleware.cors
import
CORSMiddleware
from
app.api
import
canvas
,
chat
,
health
,
retrieval
from
app.config
import
get_frontend_url
@
asynccontextmanager
async
def
lifespan
(
_app
:
FastAPI
):
...
...
@@ -14,7 +16,7 @@ app = FastAPI(title="Math Tutor API", version="0.1.0", lifespan=lifespan)
app
.
add_middleware
(
CORSMiddleware
,
allow_origins
=
[
"http://localhost:5173"
],
allow_origins
=
[
"http://localhost:5173"
,
get_frontend_url
()
],
allow_credentials
=
True
,
allow_methods
=
[
"*"
],
allow_headers
=
[
"*"
],
...
...
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