An API that implements the Rock-Paper-Scissors game written in Slim 4.
-
Run composer
$ composer install
-
Run the migrations:
$ touch db/rps.db $ vendor/bin/doctrine-migrations migrations:migrate
-
Run the API
$ php -d html_errors=0 -S 0.0.0.0:8888 -t public/
Create a game:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" \
http://localhost:8888/games -d '{"player1": "Rob", "player2": "Jon"}'
List games:
curl -i -H "Accept: application/json" http://localhost:8888/games
Make a move:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" \
-d '{"player": "Rob", "move": "rock"}' http://localhost:8888/games/f548aae6-3f4f-4c7f-a5fc-c0c1099411f7/moves