27 lines
554 B
Python
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)
|
|
} |