from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
from fastapi.staticfiles import StaticFiles
from routes import resume, articles, projects

app = FastAPI()

app.mount("/static", StaticFiles(directory="templates/static"), name="static")

templates = Jinja2Templates(directory="templates")

app.include_router(articles.router)
app.include_router(projects.router)
app.include_router(resume.router)

@app.get("/{full_path:path}")
async def catch_all(request: Request, full_path: str):
    return templates.TemplateResponse(
        "404.html",
        {"request": request, "path": full_path},
        status_code=404
    )
