netadm/routers/web/start_page.py

20 lines
479 B
Python

from fastapi import APIRouter
from starlette.requests import Request
from starlette.responses import HTMLResponse
from starlette.templating import Jinja2Templates
from config import TEMPLATES_DIR
router = APIRouter()
templates = Jinja2Templates(directory=TEMPLATES_DIR)
@router.get("/", response_class=HTMLResponse)
async def start_page(request: Request):
return templates.TemplateResponse(
"base.html",
{
"request": request,
},
)