feat(backend): add FastAPI app entry point
This commit is contained in:
27
backend/src/config.py
Normal file
27
backend/src/config.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from functools import lru_cache
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
env_file_encoding="utf-8",
|
||||
case_sensitive=False,
|
||||
)
|
||||
|
||||
app_name: str = "CodeTutor API"
|
||||
app_version: str = "0.1.0"
|
||||
debug: bool = False
|
||||
|
||||
database_url: str
|
||||
|
||||
cors_origins: list[str] = ["http://localhost:3000"]
|
||||
|
||||
default_page_size: int = 20
|
||||
max_page_size: int = 100
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
Reference in New Issue
Block a user