Update code in endpoints/countries.get.py
This commit is contained in:
parent
800a18667d
commit
9012ec4d2d
30
endpoints/countries.get.py
Normal file
30
endpoints/countries.get.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
|
from core.database import fake_users_db
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.get("/countries")
|
||||||
|
async def countries_handler():
|
||||||
|
"""Get list of South American countries"""
|
||||||
|
south_american_countries = [
|
||||||
|
"Argentina",
|
||||||
|
"Bolivia",
|
||||||
|
"Brazil",
|
||||||
|
"Chile",
|
||||||
|
"Colombia",
|
||||||
|
"Ecuador",
|
||||||
|
"Guyana",
|
||||||
|
"Paraguay",
|
||||||
|
"Peru",
|
||||||
|
"Suriname",
|
||||||
|
"Uruguay",
|
||||||
|
"Venezuela"
|
||||||
|
]
|
||||||
|
|
||||||
|
return {
|
||||||
|
"message": "South American countries retrieved successfully",
|
||||||
|
"data": south_american_countries,
|
||||||
|
"metadata": {
|
||||||
|
"total_countries": len(south_american_countries)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user