Class: ServiceTemplate::Middleware::AppMonitor
- Inherits:
-
Object
- Object
- ServiceTemplate::Middleware::AppMonitor
- Defined in:
- lib/service_template/middleware/app_monitor.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ AppMonitor
constructor
A new instance of AppMonitor.
Constructor Details
#initialize(app) ⇒ AppMonitor
Returns a new instance of AppMonitor.
4 5 6 |
# File 'lib/service_template/middleware/app_monitor.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/service_template/middleware/app_monitor.rb', line 8 def call(env) if ["/health", "/health.json"].include? env['PATH_INFO'] [200, { 'Content-type' => 'application/json' }, [ServiceTemplate::Identity.health.to_json]] else @app.call(env) end end |