Created
December 3, 2011 21:39
-
-
Save andrewmcdonough/1428231 to your computer and use it in GitHub Desktop.
Spotify apps api tips
This file contains 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
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