Sha256: 0e652e72b26b9512f3f6a5bf5d14282508cb7ca53ae827056b91b4094a43b621

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

# frozen_string_literal: true

module MiddlewareHealthcheck
  class Middleware
    PATH_INFO_KEY = 'PATH_INFO'

    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-1.0.1 lib/middleware_healthcheck/middleware.rb
middleware_healthcheck-1.0.0 lib/middleware_healthcheck/middleware.rb