Sha256: f38b4bac95a146710ee82c87b54bec2d1beefc6496190a17fed566528d594642

Contents?: true

Size: 613 Bytes

Versions: 2

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true

require "dry/system/provider/source"

module Hanami
  module Providers
    class Rack < Dry::System::Provider::Source
      def prepare
        require "dry/monitor"
        require "hanami/web/rack_logger"
      end

      def start
        target.start :logger

        notifications = target[:notifications]

        monitor_middleware = Dry::Monitor::Rack::Middleware.new(notifications)

        rack_logger = Hanami::Web::RackLogger.new(target[:logger])
        rack_logger.attach(monitor_middleware)

        register "monitor", monitor_middleware
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hanami-2.0.0.beta1.1 lib/hanami/providers/rack.rb
hanami-2.0.0.beta1 lib/hanami/providers/rack.rb