from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.db.session import create_tables from app.routers import tasks app = FastAPI( title="Task Management API", description="A simple task management tool built with FastAPI", version="1.0.0", openapi_url="/openapi.json" ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) create_tables() app.include_router(tasks.router, prefix="/tasks", tags=["tasks"]) @app.get("/") def root(): return { "title": "Task Management API", "description": "A simple task management tool built with FastAPI", "documentation": "/docs", "health_check": "/health" } @app.get("/health") def health_check(): return {"status": "healthy", "service": "Task Management API"}