From df2b0c6184359133b9d3ae2997a8b13ca973342d Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 21 Mar 2025 20:01:28 +0000 Subject: [PATCH] Update code in endpoints/africa.get.py --- endpoints/africa.get.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 endpoints/africa.get.py diff --git a/endpoints/africa.get.py b/endpoints/africa.get.py new file mode 100644 index 0000000..c1d3ea3 --- /dev/null +++ b/endpoints/africa.get.py @@ -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) + } \ No newline at end of file