wip config: another try

Co-Authored-by: iGor milhit <igor@milhit.ch>
config-2
iGor milhit 2026-01-06 16:30:09 +01:00
parent 6d98d4f5aa
commit 297fe13a5e
Signed by: igor
GPG Key ID: 692D97C3D0228A99
2 changed files with 19 additions and 0 deletions

18
config.py 100644
View File

@ -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()

View File

@ -19,6 +19,7 @@ app.add_middleware(
allow_headers=["*"],
)
@app.get("/")
async def root():
return {"message": "Hello World!"}