Sha256: 820cd33e7f10dc6ed5f8fa8e9ebde8a25b477077a8a28ccbd3dc6e299a258428

Contents?: true

Size: 469 Bytes

Versions: 11

Compression:

Stored size: 469 Bytes

Contents

module PhantomProxy
  class Service < Goliath::API
    use Goliath::Rack::Params

    def response(env)
      env["params"] = params
      call_stack(env, StatusApi, ProxyApi)
    end

    def call_stack(env, *apis)
      last_answer = [404,{}, ""]
      apis.each do |api|
        last_answer = api.call(env)
        if last_answer[0] != 600
          return last_answer
        end
      end
      last_answer[0] != 600 ? last_answer : [404,{}, ""]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
phantom_proxy-1.4.0 lib/phantom_proxy/service.rb
phantom_proxy-1.3.12 lib/phantom_proxy/service.rb
phantom_proxy-1.3.11 lib/phantom_proxy/service.rb
phantom_proxy-1.3.10 lib/phantom_proxy/service.rb
phantom_proxy-1.3.9 lib/phantom_proxy/service.rb
phantom_proxy-1.3.8 lib/phantom_proxy/service.rb
phantom_proxy-1.3.7 lib/phantom_proxy/service.rb
phantom_proxy-1.3.6 lib/phantom_proxy/service.rb
phantom_proxy-1.3.5 lib/phantom_proxy/service.rb
phantom_proxy-1.3.3 lib/phantom_proxy/service.rb
phantom_proxy-1.3.0 lib/phantom_proxy/service.rb