from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles

from app.database import UPLOAD_DIR, Base, engine
from app.routers import pdf, recipes

Base.metadata.create_all(bind=engine)

app = FastAPI(title="RecipeInator")

app.include_router(recipes.router)
app.include_router(pdf.router)

app.mount("/uploads", StaticFiles(directory=UPLOAD_DIR), name="uploads")


@app.get("/api/health")
def health():
    return {"status": "ok"}
