feat: add CI/CD workflow and sync latest workspace changes
This commit is contained in:
+2
-29
@@ -1,30 +1,3 @@
|
||||
from functools import lru_cache
|
||||
from .core.config import Settings, get_settings
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
api_name: str = "fquiz-api"
|
||||
api_version: str = "0.1.0"
|
||||
api_host: str = "0.0.0.0"
|
||||
api_port: int = 8000
|
||||
api_cors_origins: str = "http://localhost:3000,http://127.0.0.1:3000"
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
env_file_encoding="utf-8",
|
||||
case_sensitive=False,
|
||||
)
|
||||
|
||||
@property
|
||||
def cors_origins(self) -> list[str]:
|
||||
return [
|
||||
origin.strip()
|
||||
for origin in self.api_cors_origins.split(",")
|
||||
if origin.strip()
|
||||
]
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
__all__ = ["Settings", "get_settings"]
|
||||
|
||||
Reference in New Issue
Block a user