- pyproject.toml con FastAPI, SQLAlchemy 2.x, Alembic, Pydantic v2, openpyxl, rapidfuzz, Faker; dev: pytest, httpx, ruff - app/: config desde entorno, engine SQLite con WAL y sesión sin borrado físico, stubs por fase - seed/ y tests/fixtures/ con README; .gitignore excluye *.xlsx fuera de seed/ y tests/fixtures/ - test de /api/health con cliente de prueba y SQLite en memoria
20 lines
463 B
Python
20 lines
463 B
Python
"""Aplicación FastAPI: montaje de routers y `/api/health`."""
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from app import __version__
|
|
|
|
|
|
def crear_app() -> FastAPI:
|
|
app = FastAPI(title="collina-pld", version=__version__)
|
|
|
|
@app.get("/api/health", tags=["sistema"])
|
|
def health() -> dict[str, str]:
|
|
return {"status": "ok", "version": __version__}
|
|
|
|
# Los routers (app/routers/) se montan aquí conforme avanzan las fases.
|
|
return app
|
|
|
|
|
|
app = crear_app()
|