CD / api /api-gateway /app /core /config.py
tkadkghdlf's picture
Sync from GitHub via hub-sync
f711f7f verified
Raw
History Blame Contribute Delete
788 Bytes
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
)
project_name: str = "Tranimal API Gateway"
api_v1_prefix: str = "/api/v1"
auth_service_url: str = "http://auth-service:8001"
ai_service_url: str | None = None
ai_proxy_timeout_seconds: int = 900
cors_origins: str = "http://localhost:3000,http://127.0.0.1:3000"
@property
def cors_origin_list(self) -> list[str]:
return [origin.strip() for origin in self.cors_origins.split(",") if origin.strip()]
@property
def ai_enabled(self) -> bool:
return bool(self.ai_service_url)
settings = Settings()