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.
6 7 8 |
# File 'lib/kuby/middleware/health_check.rb', line 6 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
4 5 6 |
# File 'lib/kuby/middleware/health_check.rb', line 4 def app @app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 |
# File 'lib/kuby/middleware/health_check.rb', line 10 def call(env) return [204, {}, ['']] if env.fetch('PATH_INFO') == '/healthz' app.call(env) end |