feat: fastapi-backend mit healthcheck und alembic-basis
- GET /api/health prüft die Datenbankverbindung - SQLite im WAL-Modus unter /data/app.db - Auslieferung des gebauten Frontends mit SPA-Fallback - leere Basis-Migration, Tests mit pytest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff666175d0
commit
8e6ef05304
15 files changed
+414
No files matched your search
@@ -0,0 +1,21 @@
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
||||
|
||||
data_dir: Path = Path("/data")
|
||||
static_dir: Path = Path("/app/static")
|
||||
log_level: str = "info"
|
||||
|
||||
@property
|
||||
def database_url(self) -> str:
|
||||
return f"sqlite:///{self.data_dir / 'app.db'}"
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
Reference in new issue
Block a user