Closed michaelkirk closed 9 years ago
I changed the requirements slightly, based on the seat-of-my-pants design.
This became a method on the GamesController, not on the spots collection.
GET api.biketag.org/v1/games/1/spots/current
{
"spot": {
"id":3,
"created_at":"2015-03-17T01:54:09.641Z",
"image_url":"http://biketag-development.s3.amazonaws.com/spots/images/000/000/003/medium/952_lucile.jpg?1426557241"
"url":"http://192.168.59.103:3000/api/v1/games/1/spot/3.json",
"user_id":1,
"user_name":"michael"
}
}
FYI this was delivered with: michaelkirk/biketag-api@aa7311fe18f8c6fde69037c9c60beb84b066b5c9 and michaelkirk/biketag-api@b7ab6f52c5176812c96007e29e3306873d5c037c
I suppose this doesn't do anything until there is some client code to make use of it =).
OK! Client code here: https://github.com/michaelkirk/biketag/commit/10657994257f8c720649e0213f4ea9868cc5f855
And some progress indicator polish here: https://github.com/michaelkirk/biketag/commit/60783d2dbdbc979a2dca157aa9dde869c42cb5dc
example response
Note: currently we're using the device ID as a user id. I'm hoping to push off inventing a log flow, but... maybe it's not worth thinking through the process of handling the API upgrade.
Note the
/games/1
in the url - Currently here is only one game, but I'm confident we'll want to eventually support multiple simultaneous games - adding this prefix let's us be forward compatible with what the multi game API might look like. I hope I don't regret that.