- Create a player (
POST /players
) - Start a session (
POST /sessions
) to get a token. Tokens are short lived. You have to repeat this step each time the token is invalidated.
- Check the list of players (
GET /players
) - Start a match against one (
POST /matches
) - Check the match status to see if it's your turn (
GET /matches/:match_id
) - When it's your turn, play (
PATCH /matches/:match_id
) - Repeat from 3 until the response from 3 or 4 indicates the game is over
- Check the list of AI players (
GET /ai-players
) - Start a match against one (
POST /matches
). - Check the response from 2, it's your turn now
- Play (
PATCH /matches/:match_id
) - If you haven't won yet, check the match status (
GET /matches/:match_id
) - If you haven't lost yet, repeat from 4
- Delete the session (
DELETE /sessions/:session_token
)
- Delete the match (
DELETE /matches/:match_id
)
Boot up the server and check the API's Swagger Page