Skip to content

Instantly share code, notes, and snippets.

@andrewmcdonough
Created December 3, 2011 21:39
Show Gist options
  • Save andrewmcdonough/1428231 to your computer and use it in GitHub Desktop.
Save andrewmcdonough/1428231 to your computer and use it in GitHub Desktop.
Spotify apps api tips
Firstly, I was having problems accessing port 3000 on localhost, so I switched to pow,
so I could access http://spotview.dev (http://pow.cx/)
Secondly, the manifest.json file is only reloaded when you close and reopen the app,
so when you add your http://myapp.dev to the RequiredPermissions array, make sure you
close and reopen.
Finally, you need to set a response header of Access-Control-Allow-Origin: *. I did this
in rails with a filter in the controller, but you could do this more cleanly with rack
or a custom responder. My (slightly dirty) solution:
class ApplicationController < ActionController::Base
...
before_filter :set_headers
def set_headers
response.headers["Access-Control-Allow-Origin"] = "*"
end end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment