This API simulates a chess game using RESTful API endpoints.
POST /game/new
- Creates new game - returns game ID and a pre-populated boardGET /game/:game_id
- current state of the gameboardPUT /game/:game_id
- uses Chess Notation to make a move - ex.{ "moveStatement": "e4" }
- Moves the white pawn on e2 to e4GET /game/:game_id/possibleMoves/:move
- Uses Chess Notation to see possible moves - ex./game/608209c4480e828b83f020bd/possibleMoves/e4
- Shows an array of possible moves from that point on the boardGET /game/:game_id/history
- history of the game - not implemented
{
"createdAt": <<unix time>>,
"updatedAt": <<unix time>>,
"id": << auto generated id >>,
"currentPlayer": "white",
"board": {
"a1": {
"state": {
"occupied": true,
"color": "W",
"piece": "R"
}
},
"a2": {
"state": {
"occupied": true,
"color": "W",
"piece": "P"
}
},
"a3": {
"state": {
"occupied": false,
"color": null,
"piece": null
}
}
}
}
{
"validMoves": [
"e5",
"exd5"
]
}
https://www.chess.com/article/view/chess-notation#algebraic-notation
- sails-mongo - Used to connect to mongodb
- Node.js 14
- MongoDB
To use this app, check it out from Github, then do the following:
npm install
sails lift
- Use http://localhost:1337/ as the host name in all your requests.
This is an API-only application. There is no UI.