diff --git a/config.py b/config.py new file mode 100644 index 0000000..59d9d39 --- /dev/null +++ b/config.py @@ -0,0 +1,18 @@ +from pydantic_settings import BaseSettings +from functools import lru_cache + +class Settings(BaseSettings): + # CORS + cors_origins: str = "http://localhost:5173" + + # Autres configurations futures + app_name: str = "Dough Calculator" + debug: bool = False + + class Config: + env_file = ".env" + env_file_encoding = "utf-8" + +@lru_cache() +def get_settings() -> Settings: + return Settings() diff --git a/main.py b/main.py index 84dcd57..09ddb60 100644 --- a/main.py +++ b/main.py @@ -19,6 +19,7 @@ app.add_middleware( allow_headers=["*"], ) + @app.get("/") async def root(): return {"message": "Hello World!"}