Created
December 15, 2012 18:35
-
-
Save mscoutermarsh/4297940 to your computer and use it in GitHub Desktop.
CORS - rails/grape
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
# Add this to your application.rb | |
config.middleware.use Rack::Cors do | |
allow do | |
origins '*' | |
# location of your API | |
resource '/api/*', :headers => :any, :methods => [:get, :post, :options, :put] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!