diff --git a/endpoints/aid.post.py b/endpoints/aid.post.py new file mode 100644 index 0000000..9735487 --- /dev/null +++ b/endpoints/aid.post.py @@ -0,0 +1,36 @@ +```python +from fastapi import APIRouter, HTTPException +import uuid + +games = [] # In-memory storage + +router = APIRouter() + +@router.post("/aid") +async def save_games( + games_list: list +): + """Save list of games to the database""" + if request.method != "POST": + raise HTTPException(status_code=405, detail="Method Not Allowed") + + for game in games_list: + game_id = str(uuid.uuid4()) + games.append({ + "id": game_id, + "game": game + }) + + return { + "method": "POST", + "_verb": "post", + "message": "Games saved successfully", + "games_saved": len(games_list) + } +``` + +``` +# requirements.txt +fastapi +uvicorn +``` \ No newline at end of file