2025-03-23 16:52:11 +01:00

28 lines
519 B
Python

from fastapi import APIRouter, HTTPException
router = APIRouter()
towns = [
"Yaounde",
"Douala",
"Garoua",
"Bafoussam",
"Bamenda",
"Nkongsamba",
"Kumba",
"Ngaoundere",
"Maroua",
"Buea"
]
@router.post("/open")
async def get_towns():
"""Returns list of towns in Cameroun"""
if request.method != "POST":
raise HTTPException(status_code=405, detail="Method Not Allowed")
return {
"method": "POST",
"_verb": "post",
"towns": towns
}