Update code in endpoints/liverpool.get.py
This commit is contained in:
parent
4449917a0a
commit
37a4fa330f
@ -0,0 +1,46 @@
|
|||||||
|
from fastapi import APIRouter
|
||||||
|
import random
|
||||||
|
|
||||||
|
musicians = [
|
||||||
|
{
|
||||||
|
"name": "Sinach",
|
||||||
|
"hits": ["Way Maker", "I Know Who I Am", "Great Are You Lord"],
|
||||||
|
"years_active": "2002-present"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Nathaniel Bassey",
|
||||||
|
"hits": ["Imela", "Onise Iyanu", "Olowogbogboro"],
|
||||||
|
"years_active": "2008-present"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Mercy Chinwo",
|
||||||
|
"hits": ["Excess Love", "Chinedum", "Onyedikagi"],
|
||||||
|
"years_active": "2012-present"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Frank Edwards",
|
||||||
|
"hits": ["Mma Mma", "You Too Dey Bless Me", "If God Be For Me"],
|
||||||
|
"years_active": "2008-present"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tim Godfrey",
|
||||||
|
"hits": ["Nara", "Agidigba", "Na You Be God"],
|
||||||
|
"years_active": "2006-present"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.get("/liverpool")
|
||||||
|
async def get_random_musician():
|
||||||
|
"""Returns a random Nigerian gospel musician"""
|
||||||
|
musician = random.choice(musicians)
|
||||||
|
return {
|
||||||
|
"method": "GET",
|
||||||
|
"_verb": "get",
|
||||||
|
"musician": musician,
|
||||||
|
"features": {
|
||||||
|
"total_musicians": len(musicians),
|
||||||
|
"random_selection": True
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user