Class: Napa::Middleware::AppMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/napa/middleware/app_monitor.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ AppMonitor

Returns a new instance of AppMonitor.



4
5
6
# File 'lib/napa/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/napa/middleware/app_monitor.rb', line 8

def call(env)
  if ["/health", "/health.json"].include? env['PATH_INFO']
    [200, { 'Content-type' => 'application/json' }, [Napa::Identity.health.to_json]]
  else
    @app.call(env)
  end
end