Created
December 25, 2014 15:52
-
-
Save Arakaki-Yuji/a61f89f671d953915d98 to your computer and use it in GitHub Desktop.
APIファーストでバックエンドとフロントエンドを別々に開発する時にハマるクロスドメインアクセス ref: http://qiita.com/arakaji/items/f7d32e1c94d67b3e2606
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
module YourApp | |
class Application < Rails::Application | |
# ... | |
config.middleware.insert_before 0, "Rack::Cors" do | |
allow do | |
origins 'your_app_domain' | |
resource '*', :headers => :any, :methods => [:get, :post, :put, :delete, :options] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment