Automated Action 28f6914da1 Build task manager API with FastAPI and SQLite
- Set up project structure with FastAPI
- Implement SQLAlchemy models for User and Task
- Create Alembic migrations
- Implement authentication with JWT
- Add CRUD operations for tasks
- Add task filtering and prioritization
- Configure health check endpoint
- Update README with project documentation
2025-06-17 08:37:23 +00:00

42 lines
963 B
Python

import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.api_v1.api import api_router
from app.core.config import settings
app = FastAPI(
title=settings.PROJECT_NAME,
description=settings.PROJECT_DESCRIPTION,
openapi_url="/openapi.json",
)
# Set up CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allow all origins
allow_credentials=True,
allow_methods=["*"], # Allow all methods
allow_headers=["*"], # Allow all headers
)
# Include API router
app.include_router(api_router, prefix=settings.API_V1_STR)
@app.get("/", tags=["Root"])
async def root():
return {
"title": settings.PROJECT_NAME,
"docs": "/docs",
"health": "/health"
}
@app.get("/health", tags=["Health"])
async def health_check():
return {"status": "healthy"}
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)