Sha256: a927ed5351f23e66f7ad3a3c3b85131ab25d689294fb04cd93b3c9c838d99283

Contents?: true

Size: 580 Bytes

Versions: 4

Compression:

Stored size: 580 Bytes

Contents

class Recipes::RackCors < Rails::AppBuilder
  def create
    gather_gem('rack-cors', '~> 0.4.0')
    after(:gem_install) do
      rack_cors_config =
        <<-RUBY.gsub(/^ {7}/, '')
           config.middleware.insert_before 0, "Rack::Cors" do
             allow do
               origins '*'
               resource '*',
                 headers: :any,
                 expose: ['X-Page', 'X-PageTotal'],
                 methods: [:get, :post, :delete, :put, :options]
             end
           end
           RUBY

      application rack_cors_config.strip
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
potassium-2.3.0 lib/potassium/recipes/rack_cors.rb
potassium-2.2.0 lib/potassium/recipes/rack_cors.rb
potassium-2.1.0 lib/potassium/recipes/rack_cors.rb
potassium-2.0.0 lib/potassium/recipes/rack_cors.rb