diff --git a/backend/config.py b/backend/config.py index 88b58c670ecd96b2648bd3f2cd1df3f3d35ea1b1..313984a9ab5a6cfb61bbd4d1481c44b61d9e4d3a 100644 --- a/backend/config.py +++ b/backend/config.py @@ -5,6 +5,9 @@ class Settings(BaseSettings): # we may want use DSN validators from pydantic. # but there are no sqlite validators? database_url: str = "sqlite:///./paketshop.db" + backend_url: str = "http://localhost:8000" + customer_url: str = "http://localhost:3000" + worker_url: str = "http://localhost:3002" class Config: env_file = ".env" diff --git a/backend/main.py b/backend/main.py index 3b9af59a20b603ec2b778f22df81bd3ff8a422d3..af974d8d896018c1e30edbebcb64c6924cb353f1 100644 --- a/backend/main.py +++ b/backend/main.py @@ -5,13 +5,14 @@ from fastapi.middleware.cors import CORSMiddleware from sqlalchemy.orm import Session from . import schemas, utils +from .config import settings from .database import SessionLocal, create_database create_database() app = FastAPI() -origins = ["http://127.0.0.1:8000", "http://localhost:3000", "http://localhost:3002"] +origins = [settings.customer_url, settings.worker_url] app.add_middleware(