Sha256: 17071d929814a2527b833f5e10fbbffe881b6c4644234e65680a3ab6b2d960ff

Contents?: true

Size: 386 Bytes

Versions: 1

Compression:

Stored size: 386 Bytes

Contents

# frozen_string_literal: true

class Async::App::WebApps::HealthApp
  include Async::App::WebComponent
  include Async::App::AutoloadComponent

  PATHS = ["/health", "/health/"].freeze

  def after_init
    @healthy = false
    bus.subscribe("health.updated") { @healthy = _1 }
  end

  def can_handle?(request) = PATHS.include?(request.path)
  def call(_) = [@healthy ? 200 : 500]
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async-tools-0.2.10 lib/async/app/web_apps/health_app.rb