diff --git a/endpoints/kenya.get.py b/endpoints/kenya.get.py new file mode 100644 index 0000000..c9c0dd6 --- /dev/null +++ b/endpoints/kenya.get.py @@ -0,0 +1,24 @@ +from fastapi import APIRouter, HTTPException + +router = APIRouter() + +west_nigeria_states = [ + "Ekiti", + "Lagos", + "Ogun", + "Ondo", + "Osun", + "Oyo" +] + +@router.get("/kenya", response_model=dict) +async def get_west_nigeria_states(): + """Returns list of states in west Nigeria""" + if request.method != "GET": + raise HTTPException(status_code=405, detail="Method Not Allowed") + + return { + "method": "GET", + "_verb": "get", + "west_nigeria_states": west_nigeria_states + } \ No newline at end of file