akai-org / akai-org/love_letter

Create API endpoint POST /api/v1/games

Open
#25 0 comments 0 reactions 1 assignee Claimed by @MaciejWojt View on GitHub
backend
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Implement API endpoint (in file src/routers/api.py) which will react to POST /api/v1/games with JSON
```
{
‘room_name’: ,
‘max_players’: ,
`password`: ,
}
```
Where “max_players” is limited to values 2-6

If success, append a new room to the imported object "game_manager" (method add_new_game), then return JSON with a status code 200 (Ok):
```
{
‘room_name’: ,
‘max_players’: ,
‘password’:
}
```

If the room exists with a specific name, return JSON with a status code 403 (Forbidden):
```
{
‘message’: “The room {room_name} already exists”
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.