Skip to content

Instantly share code, notes, and snippets.

@wearethefoos
Created April 28, 2016 14:19
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 wearethefoos/6aa06973f19729bdd20fe6b95cfd30af to your computer and use it in GitHub Desktop.
Save wearethefoos/6aa06973f19729bdd20fe6b95cfd30af to your computer and use it in GitHub Desktop.
class VideogameReviews::Application
config.middleware.insert_before 0, "Rack::Cors", debug: true, logger: (-> { Rails.logger }) do
allow do
origins 'localhost:3000', '127.0.0.1:3000'
resource '/cors',
headers: :any,
methods: [:post],
credentials: true,
max_age: 0
resource '*',
headers: :any,
methods: [:get, :post, :delete, :put, :patch, :options, :head],
max_age: 0
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment