Fix: Add ALLOWED_ORIGINS to settings with cors_origins property

This commit is contained in:
2025-11-18 18:34:19 -03:00
parent 08fc88668d
commit e7a380f36e
3 changed files with 19 additions and 7 deletions

View File

@@ -16,12 +16,21 @@ class Settings(BaseSettings):
# Environment
ENVIRONMENT: str = "development"
# CORS - Orígenes permitidos separados por coma
ALLOWED_ORIGINS: str = "http://localhost:3000,http://localhost:5173"
# Uploads
UPLOAD_DIR: str = "uploads"
MAX_FILE_SIZE: int = 10 * 1024 * 1024 # 10MB
@property
def cors_origins(self) -> list:
"""Convierte el string de origins separado por comas en una lista"""
return [origin.strip() for origin in self.ALLOWED_ORIGINS.split(",") if origin.strip()]
class Config:
env_file = ".env"
case_sensitive = True
extra = "ignore" # Permite variables extras sin error
settings = Settings()