Initial Commit

This commit is contained in:
2026-02-23 16:42:35 +01:00
commit a5c93d1f8a
12 changed files with 458 additions and 0 deletions

14
app/main.py Normal file
View File

@ -0,0 +1,14 @@
from contextlib import asynccontextmanager
from fastapi import FastAPI
from app.database import engine
from app.routers import authors, books
@asynccontextmanager
async def lifespan(app: FastAPI):
yield # tables already created by Create.sql
await engine.dispose()
app = FastAPI(title="Database API", lifespan=lifespan)
app.include_router(authors.router)
app.include_router(books.router)