
- Set up project structure with FastAPI - Create SQLite database models with SQLAlchemy - Implement Alembic for migrations - Create API endpoints for todo operations - Add health check endpoint - Update README.md with comprehensive documentation generated with BackendIM... (backend.im)
23 lines
550 B
Python
23 lines
550 B
Python
from fastapi import FastAPI
|
|
from app.api.routes import todo_router
|
|
from app.core.config import settings
|
|
from app.db.session import create_tables
|
|
|
|
app = FastAPI(
|
|
title=settings.PROJECT_NAME,
|
|
description=settings.PROJECT_DESCRIPTION,
|
|
version=settings.PROJECT_VERSION
|
|
)
|
|
|
|
# Create tables on startup
|
|
@app.on_event("startup")
|
|
async def startup_event():
|
|
create_tables()
|
|
|
|
# Include routers
|
|
app.include_router(todo_router)
|
|
|
|
# Health check endpoint
|
|
@app.get("/health", tags=["Health"])
|
|
async def health_check():
|
|
return {"status": "healthy"} |