Sha256: b612af22000ea93b0a3aba69d7587fc6a4c755a76cd558d8116aaa714e1b2e2c

Contents?: true

Size: 748 Bytes

Versions: 14

Compression:

Stored size: 748 Bytes

Contents

require 'active_support/configurable'

module Gris
  class Application
    include ActiveSupport::Configurable
    config_accessor :use_health_middleware
    config_accessor :use_error_handlers_middleware

    def self.instance(config = {})
      @instance ||= Rack::Builder.new do
        use Gris::Middleware::Health unless config[:use_health_middleware] == false
        use Gris::Middleware::ErrorHandlers unless config[:use_error_handlers_middleware] == false

        use Rack::Cors do
          allow do
            origins '*'
            resource '*', headers: :any, methods: :get
          end
        end
        run Gris::Application.new
      end.to_app
    end

    def call(env)
      ApplicationEndpoint.call(env)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
gris-0.6.8 lib/gris/application.rb
gris-0.6.7 lib/gris/application.rb
gris-0.6.6 lib/gris/application.rb
gris-0.6.5 lib/gris/application.rb
gris-0.6.2 lib/gris/application.rb
gris-0.6.1 lib/gris/application.rb
gris-0.6.0 lib/gris/application.rb
gris-0.5.9 lib/gris/application.rb
gris-0.5.8 lib/gris/application.rb
gris-0.5.7 lib/gris/application.rb
gris-0.5.6 lib/gris/application.rb
gris-0.5.5 lib/gris/application.rb
gris-0.5.4 lib/gris/application.rb
gris-0.5.3 lib/gris/application.rb