If you want to allow access to your Grape API from other domains, you need to implement CORS!
It’s easy with the rack-cors gem. Here’s how you do it.
Add rack-cors to your gemfile.
gem 'rack-cors', :require => 'rack/cors'
Then go to your application.rb and add: