Fix: Add ALLOWED_ORIGINS to settings with cors_origins property
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user