Class: Kuby::Middleware::HealthCheck
- Inherits:
-
Object
- Object
- Kuby::Middleware::HealthCheck
- Defined in:
- lib/kuby/middleware/health_check.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
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
#app ⇒ Object (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 |