Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create API endpoint POST /api/v1/games #25

Open
siemieniuk opened this issue Dec 6, 2023 · 0 comments
Open

Create API endpoint POST /api/v1/games #25

siemieniuk opened this issue Dec 6, 2023 · 0 comments
Assignees
Labels

Comments

@siemieniuk
Copy link
Collaborator

siemieniuk commented Dec 6, 2023

Implement API endpoint (in file src/routers/api.py) which will react to POST /api/v1/games with JSON

{
	‘room_name’: <str>,
	‘max_players’: <int>,
	`password`: <str?>,
}

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’: <str>,
	‘max_players’: <int>,
	‘password’: <str?>
}

If the room exists with a specific name, return JSON with a status code 403 (Forbidden):

{
	‘message’: “The room {room_name} already exists”
}

@siemieniuk siemieniuk changed the title Create API endpoint which creates room Create API endpoint POST /api/v1/games Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants