Update code in endpoints/movies.get.py

This commit is contained in:
Backend IM Bot 2025-03-23 21:09:58 +00:00
parent fdc5291dfa
commit 83d54b7123

View File

@ -0,0 +1,27 @@
from fastapi import APIRouter, HTTPException
movies = [
{
"title": "The Matrix",
"genre": "Sci-Fi",
"director": "Wachowski Sisters"
},
{
"title": "Inception",
"genre": "Action",
"director": "Christopher Nolan"
}
]
router = APIRouter()
@router.get("/movies")
async def get_movies():
"""Demo movies endpoint"""
return {
"message": "Movies retrieved successfully",
"method": "GET",
"_verb": "get",
"movies": movies,
"count": len(movies)
}