Update code in endpoints/movies.get.py
This commit is contained in:
parent
fdc5291dfa
commit
83d54b7123
@ -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)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user