Sha256: d88be53405e660c5ab79aa31127d6368fe12834077e28e860e5de5b3e3b7dd73

Contents?: true

Size: 350 Bytes

Versions: 2

Compression:

Stored size: 350 Bytes

Contents

module MiddlewareHealthcheck
  class Middleware
    PATH_INFO_KEY = "PATH_INFO".freeze

    def initialize(app)
      @app = app
    end

    def call(env)
      if env[PATH_INFO_KEY] == MiddlewareHealthcheck.configuration.healthcheck_path
        MainChecker.new(@app, env).check_health
      else
        @app.call(env)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
middleware_healthcheck-0.2.2 lib/middleware_healthcheck/middleware.rb
middleware_healthcheck-0.2.1 lib/middleware_healthcheck/middleware.rb