Skip to content

vtm9/bowling

Repository files navigation

Bowling REST-API

Build codecov

Documentation

Start a new bowling game

 curl -X POST  https://bowling.gigalixirapp.com/api/v1/games \
-H "Content-Type: application/json" \
-d '{"game":{"players":[{"name": "asdf"},{"name": "fdsa"}]}}'

# response
{
  "id": 1,
  "result": [
    {
      "frames": [],
      "player_name": "asdf",
      "total": 0
    },
    {
      "frames": [],
      "player_name": "fdsa",
      "total": 0
    }
  ]
}

Input the number of pins knocked down by ball

curl -X POST  https://bowling.gigalixirapp.com/api/v1/games/1/balls \
-H "Content-Type: application/json" \
-d '{"ball":{"score":10}}'

# response
{}

Get the current game score

curl -X GET  https://bowling.gigalixirapp.com/api/v1/games/1/balls \
-H "Content-Type: application/json"

# response
{
  "id": 1,
  "result": [
    {
      "frames": [
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 }, { "score": 10 }, { "score": 10 } ], "result": 30 }
      ],
      "player_name": "asdf",
      "total": 300
    },
    {
      "frames": [
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 } ], "result": 30 },
        { "balls": [ { "score": 10 }, { "score": 10 }, { "score": 10 } ], "result": 30 }
      ],
      "player_name": "fdsa",
      "total": 300
    }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published