This project is a back end API for the game Battleship. A version of this API was already created as a player vs computer game, our aim was to create a player vs player version.
In order to play, both users must register by visiting the home page and clicking on the link in the verification email. All game requests to the api will require the user's api key in the headers under X-API_Key: your-api-key
https://battleshift19.herokuapp.com/
Player 1 creates a game by sending over their API key and Player 2's email address. Both players should already exist in the system.
POST /api/v1/games
Place a ship on the requesting player's board. Player is determined by the API key sent. Should only allow players who are part of this game.
POST /api/v1/games/:game_id/ships
Send a target coordinate to fire upon the opponents board. Sender is determined by the API key that is sent over. Should only allow players who are part of this game. Should not allow a user to fire when it is not their turn.
POST /api/v1/games/:game_id/shots