diff --git a/endpoints/api/v1/endpoint.post.py b/endpoints/api/v1/endpoint.post.py new file mode 100644 index 0000000..d25ccc2 --- /dev/null +++ b/endpoints/api/v1/endpoint.post.py @@ -0,0 +1,29 @@ +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_user_names(): + """Get list of 10 user names""" + try: + users = list(fake_users_db.keys())[:10] + + if not users: + raise HTTPException(status_code=404, detail="No users found") + + return { + "message": "Successfully retrieved user names", + "data": users, + "metadata": { + "count": len(users), + "limit": 10, + "source": "demo_db" + } + } + except Exception as e: + raise HTTPException( + status_code=500, + detail=f"Internal server error: {str(e)}" + ) \ No newline at end of file