Skip to content

Instantly share code, notes, and snippets.

@localredhead
Created April 10, 2015 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save localredhead/50687fbf83b904ead864 to your computer and use it in GitHub Desktop.
Save localredhead/50687fbf83b904ead864 to your computer and use it in GitHub Desktop.
CORS development.rb
config.middleware.insert_before 0, "Rack::Cors", :debug => true, :logger => (-> { Rails.logger }) do
allow do
origins '*'
resource '/cors',
:headers => :any,
:methods => [:post],
:credentials => true,
:max_age => 0
resource '*',
:headers => :any,
:methods => [:get, :post, :delete, :put, :options, :head],
:max_age => 0
end
end
@localredhead
Copy link
Author

This allows two apps running in development to access the same domain from a different subdomain (shop.archer.dev -> client.archer.dev)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment