Created
January 2, 2020 13:08
-
-
Save sorokadima/92aae1e9952a2965fb26a90dff1a7752 to your computer and use it in GitHub Desktop.
Rails CORS (Ruby on Rails Cross-Origin Resource Sharing)
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
module Carservice | |
class Application < Rails::Application | |
config.middleware.insert_before 0, "Rack::Cors" do | |
allow do | |
origins '*' | |
resource '*', headers: :any, methods: [:get, :post, :options] | |
end | |
end |
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
gem 'rack-cors' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment