From a5cd381890be8cbb9c6244cf17be4dd231b2d805 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 18 Mar 2025 16:54:23 +0000 Subject: [PATCH] feat: Update endpoint countries --- endpoints/countries.get.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/endpoints/countries.get.py b/endpoints/countries.get.py index e69de29..0d9f8a8 100644 --- a/endpoints/countries.get.py +++ b/endpoints/countries.get.py @@ -0,0 +1,31 @@ +from fastapi import APIRouter, Depends, HTTPException +from core.database import fake_users_db +from typing import List + +router = APIRouter() + +@router.post("/api/v1/endpoint") +async def get_african_countries(): + """Return list of all countries in Africa""" + + 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" + ] + + return { + "message": "African countries retrieved successfully", + "data": african_countries, + "metadata": { + "total_countries": len(african_countries), + "continent": "Africa" + } + } \ No newline at end of file