api / app /config.py
Mate11
CARPETA DUPLICADA
31c8dd6
Raw History Blame
1.29 kB
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
case_sensitive=False,
extra="ignore",
)
# Base de datos — sin default para forzar configuración explícita en producción
database_url: str
# JWT — sin default para evitar secretos hardcodeados en código fuente
jwt_secret: str
jwt_algorithm: str = "HS256"
jwt_expire_minutes: int = 60
# Entorno — controla comportamiento de endpoints de desarrollo
environment: str = "development"
# CORS — lista explícita de orígenes permitidos
allowed_origins: list[str] = ["http://localhost:3000", "http://localhost:5173"]
# Timeout HTTP para llamadas a módulos externos (segundos)
http_timeout_seconds: float = 5.0
# URLs de módulos externos
m1_hce_url: str = "http://localhost:8001"
m2_turnos_url: str = "http://localhost:8002"
m7_facturacion_url: str = "http://localhost:8007"
m9_monitoreo_url: str = "http://localhost:8009"
m10_core_url: str = "http://localhost:8010"
# Si True, no llama a módulos externos (útil para desarrollo local sin stack completo)
mock_external_services: bool = True
settings = Settings()