Created
August 25, 2014 13:30
-
-
Save sgoodwin/5d92b496e0e2a1f82759 to your computer and use it in GitHub Desktop.
An example API to test offline queuing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'sinatra/json' | |
items = { "234" => { "name" => "Pokemon", "isLiked" => false, "id" => "234" } } | |
get '/' do | |
hash = { "data" => items.values } | |
json hash | |
end | |
put '/' do | |
item = items[params[:item_id]] | |
item["isLiked"] = !item["isLiked"] | |
puts items | |
200 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment