febus982/bootstrap-python-fastapi

View on GitHub
src/http_app/routes/hello.py

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse

from http_app.templates import templates

router = APIRouter(prefix="/hello")


@router.get("/", response_class=HTMLResponse, include_in_schema=False)
async def hello(request: Request):
    return templates.TemplateResponse("hello.html", {"request": request})