Work in Progress
This project works with Python 3.7 or higger version
- Create a python virtual environment.
Example with pyenv:
brew install pyenv(pyenv Documentation)brew install pyenv-virtualenv(pyenv-virtualenv Documentation)pyenv virtualenv 3.7.3 chesspyenv activate chess
Example with virtualenv:
sudo apt install virtualenvvirtualenv -p python3 chessenvsource chessenv/bin/activate
- Install the requirements with
make install - Start app with command
make start-worker
- Build docker image:
make build
- Start app:
make start
- Inspect logs:
make logs
Open Postman, or other similar tools, and call http://localhost:5000/game with JSON data in following format:
{
"player1": {"name": "Name-a"},
"player2": {"name": "Name-b"}
}Returns an HTTP 200 OK. The payload contains the following keys: board and id and players.
Use the ID to continue to play using the /game/<ID> endpoint. Like http://127.0.0.1:5000/game/ID
The game payload should contain the player name, the position of the piece you want to move and the
position of where you want to move the piece to.
Example:
{
"player": "Name",
"position": "e2",
"new_position": "e4"
}make test