diff --git a/endpoints/whatsapp.get.py b/endpoints/whatsapp.get.py index e69de29..65ae9d5 100644 --- a/endpoints/whatsapp.get.py +++ b/endpoints/whatsapp.get.py @@ -0,0 +1,27 @@ +from fastapi import APIRouter +import random + +african_countries = [ + "Nigeria", "Egypt", "South Africa", "Kenya", "Ethiopia", + "Ghana", "Tanzania", "Uganda", "Algeria", "Morocco", + "Zimbabwe", "Zambia", "Rwanda", "Senegal", "Mali", + "Angola", "Mozambique", "Cameroon", "Niger", "Malawi" +] + +router = APIRouter() + +@router.get("/whatsapp") +async def get_random_country(): + """Returns random African country""" + country = random.choice(african_countries) + + return { + "method": "GET", + "_verb": "get", + "country": country, + "message": f"Random African country: {country}", + "features": { + "total_countries": len(african_countries), + "region": "Africa" + } + } \ No newline at end of file