2025-03-23 16:47:21 +01:00

28 lines
542 B
Python

from fastapi import APIRouter, HTTPException
router = APIRouter()
towns = [
"Yaounde",
"Douala",
"Bafoussam",
"Garoua",
"Maroua",
"Bamenda",
"Ngaoundere",
"Bertoua",
"Ebolowa",
"Kribi"
]
@router.post("/open")
async def get_cameroon_towns():
"""endpoint that returns list of town in camerouns"""
if request.method != "POST":
raise HTTPException(status_code=405, detail="Method Not Allowed")
return {
"method": "POST",
"_verb": "post",
"towns": towns
}