Ruby Talks #7
Szubrycht Kamil
Text
Don't detect browser. Detect technology.
module YourApp
class Application < Rails::Application
# ...
config.middleware.insert_before 0, "Rack::Cors" do
allow do
origins '*' # or any domain
# origins 'localhost:3000'
resource '*', :headers => :any, :methods => [:get, :post, :options]
# resource '/public/*', :headers => 'x-domain-token', :methods => :get
end
end
end
end