summaryrefslogtreecommitdiff
path: root/app/routers/web.py
blob: e97bc4213a4ee66ce8c28c74134385a19a1d2361 (plain)
1
2
3
4
5
6
7
8
9
from fastapi import APIRouter, Request

router = APIRouter(prefix="/photos")

@router.get("/")
async def main_page(request: Request):
    images = request.app.state.image_service.get_all_images()
    return request.app.state.templates.TemplateResponse(
        request=request, name="index.html", context={"images": images})