import os

from fastapi import APIRouter, Request 
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates


site_router = APIRouter()
print(os.path.abspath(os.curdir))
site_router.mount("/static", StaticFiles(directory="servicemanager/frontend/static"), name="static")


templates = Jinja2Templates(directory="servicemanager/frontend/templates")


@site_router.get("/testpage", response_class=HTMLResponse)
async def read_item(request: Request):
    return templates.TemplateResponse(
        request=request, name="test.html"
    )
