JSON TicTacToe Server
A JSON TicTacToe server that provides a JSON API interface for a TicTacToe engine.
Tests
To run tests:
sbt test
Use the server
- Clone repository.
- Run the server
sbt run
Deploy to Heroku
- Clone repository
- Set the heroku app name in
build.sbt
- Run the assembly deploy command to deploy a fat jar to heroku
sbt assembly deployHeroku
Interfacing with JSON API
To interact with the JSON server, send a post request with the JSON in the body of the request.
The JSON requires two fields: board
and move
Example:
{
"board": "1,2,3,4,5,6,7,8,9",
"move": "1"
}
The response JSON contains the updated board, and messages to display.
Example Response:
{
"board":
"X,2,3,4,O,6,7,8,9",
"messages":
[
"Please select an open space.",
"That space is not available."
]
}