"...github-team.git" did not exist on "6fa89a1ef3465caaf539f8b40857854ba050ddce"
Commit a30701ae authored by Kantz's avatar Kantz
Browse files

gegenrichtung auch angepasst

parent 20d236c1
...@@ -48,6 +48,12 @@ def get_mathpix_settings() -> MathpixSettings: ...@@ -48,6 +48,12 @@ def get_mathpix_settings() -> MathpixSettings:
app_key=os.getenv("MATHPIX_APP_KEY") 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: def get_ollama_settings() -> OllamaSettings:
return OllamaSettings( return OllamaSettings(
base_url=os.getenv("OLLAMA_URL", "http://localhost:11434"), base_url=os.getenv("OLLAMA_URL", "http://localhost:11434"),
......
...@@ -3,6 +3,8 @@ from contextlib import asynccontextmanager ...@@ -3,6 +3,8 @@ from contextlib import asynccontextmanager
from fastapi import FastAPI from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from app.api import canvas, chat, health, retrieval from app.api import canvas, chat, health, retrieval
from app.config import get_frontend_url
@asynccontextmanager @asynccontextmanager
async def lifespan(_app: FastAPI): async def lifespan(_app: FastAPI):
...@@ -14,7 +16,7 @@ app = FastAPI(title="Math Tutor API", version="0.1.0", lifespan=lifespan) ...@@ -14,7 +16,7 @@ app = FastAPI(title="Math Tutor API", version="0.1.0", lifespan=lifespan)
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=["http://localhost:5173"], allow_origins=["http://localhost:5173", get_frontend_url()],
allow_credentials=True, allow_credentials=True,
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"], allow_headers=["*"],
......
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