Skip to content

Instantly share code, notes, and snippets.

@whiz25
Last active January 14, 2020 10:02
Show Gist options
  • Save whiz25/b6652003e445e13ca38a6deba2e81875 to your computer and use it in GitHub Desktop.
Save whiz25/b6652003e445e13ca38a6deba2e81875 to your computer and use it in GitHub Desktop.
cors configuration
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