Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mscoutermarsh
Created December 15, 2012 18:35
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mscoutermarsh/4297940 to your computer and use it in GitHub Desktop.
Save mscoutermarsh/4297940 to your computer and use it in GitHub Desktop.
CORS - rails/grape
# 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
@paganotoni
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment