Class: Kuby::Middleware::HealthCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/kuby/middleware/health_check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ HealthCheck

Returns a new instance of HealthCheck.



7
8
9
# File 'lib/kuby/middleware/health_check.rb', line 7

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/kuby/middleware/health_check.rb', line 5

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
# File 'lib/kuby/middleware/health_check.rb', line 11

def call(env)
  return [204, {}, ['']] if env.fetch('PATH_INFO') == '/healthz'
  app.call(env)
end