Class: Goliath::Rack::Heartbeat
- Inherits:
-
Object
- Object
- Goliath::Rack::Heartbeat
- Defined in:
- lib/goliath/rack/heartbeat.rb
Overview
A heartbeat mechanism for the server. This will add a /status endpoint that returns status 200 and content OK when executed.
Instance Method Summary (collapse)
- - (Object) call(env)
-
- (Heartbeat) initialize(app)
constructor
A new instance of Heartbeat.
Constructor Details
- (Heartbeat) initialize(app)
A new instance of Heartbeat
10 11 12 |
# File 'lib/goliath/rack/heartbeat.rb', line 10 def initialize(app) @app = app end |
Instance Method Details
- (Object) call(env)
14 15 16 17 18 19 20 |
# File 'lib/goliath/rack/heartbeat.rb', line 14 def call(env) if env['PATH_INFO'] == '/status' [200, {}, 'OK'] else @app.call(env) end end |