module Roda::RodaPlugins::Heartbeat

  1. lib/roda/plugins/heartbeat.rb

The heartbeat handles heartbeat/status requests. If a request for the heartbeat path comes in, a 200 response with a text/plain Content-Type and a body of “OK” will be returned. The default heartbeat path is “/heartbeat”, so to use that:

plugin :heartbeat

You can also specify a custom heartbeat path:

plugin :heartbeat, path: '/status'


Public Class

  1. configure


HEARTBEAT_RESPONSE = [200, {'Content-Type'=>'text/plain'}.freeze, ['OK'.freeze].freeze].freeze  

Public Class methods

configure(app, opts=OPTS)

Set the heartbeat path to the given path.

[show source]
   # File lib/roda/plugins/heartbeat.rb
20 def self.configure(app, opts=OPTS)
21   app.opts[:heartbeat_path] = (opts[:path] || app.opts[:heartbeat_path] || "/heartbeat").dup.freeze
22 end