Skip to content

Instantly share code, notes, and snippets.

@frankyston
Created October 26, 2021 01:58
Show Gist options
  • Select an option

  • Save frankyston/238445f3b13e812c6177d26db43c5e4b to your computer and use it in GitHub Desktop.

Select an option

Save frankyston/238445f3b13e812c6177d26db43c5e4b to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins ENV['CORS_ORIGINS'].split(',').map { |origin| origin.strip }
resource '*',
headers: :any,
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment