Last active
January 14, 2020 10:02
-
-
Save whiz25/b6652003e445e13ca38a6deba2e81875 to your computer and use it in GitHub Desktop.
cors configuration
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
Rails.application.config.middleware.insert_before 0, Rack::Cors do | |
allow do | |
origins "http://localhost:3000" | |
resource "*", headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head], credentials: true | |
end | |
allow do | |
origins "https://link-to-production-app.com/" | |
resource "*", headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head], credentials: true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment