shopper-wcce6w/endpoints/movies.get.py
2025-03-23 21:09:58 +00:00

27 lines
554 B
Python

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)
}