Sha256: 7b555ac77d654ffbc2289c8dd74ea4abf5f2e3a28f8a3f88f54f3159d5e936e7

Contents?: true

Size: 395 Bytes

Versions: 14

Compression:

Stored size: 395 Bytes

Contents

# frozen_string_literal: true

class Roda
  module RodaPlugins
    module Cors
      def self.configure(app, origin)
        return if origin.nil?
        require 'rack/cors'
        app.use ::Rack::Cors do
          allow do
            origins origin
            resource '*', headers: :any, methods: :any
          end
        end
      end
    end
    register_plugin(:cors, Cors)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
punk-0.3.6 lib/punk/plugins/cors.rb
punk-0.3.5 lib/punk/plugins/cors.rb
punk-0.3.4 lib/punk/plugins/cors.rb
punk-0.3.3 lib/punk/plugins/cors.rb
punk-0.3.2 lib/punk/plugins/cors.rb
punk-0.3.1 lib/punk/plugins/cors.rb
punk-0.2.0 lib/punk/plugins/cors.rb
punk-0.1.4 lib/punk/plugins/cors.rb
punk-0.1.3 lib/punk/plugins/cors.rb
punk-0.1.2 lib/punk/plugins/cors.rb
punk-0.1.0 lib/punk/plugins/cors.rb
punk-0.0.3 lib/punk/plugins/cors.rb
punk-0.0.2 lib/punk/plugins/cors.rb
punk-0.0.1 lib/punk/plugins/cors.rb