
- Set up project structure and requirements - Create database models and connection setup using SQLAlchemy - Set up Alembic migrations - Create API endpoints for Todo CRUD operations - Add health endpoint - Update README with project information generated with BackendIM... (backend.im)
22 lines
533 B
Python
22 lines
533 B
Python
from fastapi import FastAPI
|
|
from app.api import todos, health
|
|
from app.database.init_db import create_tables
|
|
|
|
app = FastAPI(
|
|
title="Todo API",
|
|
description="A simple Todo API built with FastAPI and SQLite",
|
|
version="1.0.0",
|
|
)
|
|
|
|
# Initialize database tables
|
|
@app.on_event("startup")
|
|
async def startup():
|
|
create_tables()
|
|
|
|
# Include routers
|
|
app.include_router(todos.router)
|
|
app.include_router(health.router)
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) |