Update code in endpoints/africa.get.py
This commit is contained in:
parent
43254ebe9f
commit
df2b0c6184
27
endpoints/africa.get.py
Normal file
27
endpoints/africa.get.py
Normal file
@ -0,0 +1,27 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
african_countries = [
|
||||
"Algeria", "Angola", "Benin", "Botswana", "Burkina Faso",
|
||||
"Burundi", "Cameroon", "Cape Verde", "Central African Republic",
|
||||
"Chad", "Comoros", "Congo", "Democratic Republic of the Congo",
|
||||
"Djibouti", "Egypt", "Equatorial Guinea", "Eritrea", "Ethiopia",
|
||||
"Gabon", "Gambia", "Ghana", "Guinea", "Guinea-Bissau", "Ivory Coast",
|
||||
"Kenya", "Lesotho", "Liberia", "Libya", "Madagascar", "Malawi",
|
||||
"Mali", "Mauritania", "Mauritius", "Morocco", "Mozambique",
|
||||
"Namibia", "Niger", "Nigeria", "Rwanda", "Sao Tome and Principe",
|
||||
"Senegal", "Seychelles", "Sierra Leone", "Somalia", "South Africa",
|
||||
"South Sudan", "Sudan", "Swaziland", "Tanzania", "Togo", "Tunisia",
|
||||
"Uganda", "Zambia", "Zimbabwe"
|
||||
]
|
||||
|
||||
@router.get("/africa")
|
||||
async def get_african_countries():
|
||||
"""Get list of African countries"""
|
||||
return {
|
||||
"method": "GET",
|
||||
"_verb": "get",
|
||||
"countries": african_countries,
|
||||
"total": len(african_countries)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user