def middleware(configuration, environment)
      builder.use Hanami::CommonLogger, Hanami.logger unless Hanami.logger.nil?
      builder.use Rack::ContentLength

      configuration.middleware.each do |m, args, blk|
        builder.use(m, *args, &blk)
      end

      if configuration.early_hints
        require 'hanami/early_hints'
        builder.use Hanami::EarlyHints
      end

      if middleware = environment.static_assets_middleware # rubocop:disable Lint/AssignmentInCondition
        builder.use middleware
      end

      builder.use Rack::MethodOverride
    end
def middleware(configuration, environment)
      builder.use Hanami::CommonLogger, Hanami.logger unless Hanami.logger.nil?
      builder.use Rack::ContentLength

      configuration.middleware.each do |m, args, blk|
        builder.use(m, *args, &blk)
      end

      if configuration.early_hints
        require 'hanami/early_hints'
        builder.use Hanami::EarlyHints
      end

      if middleware = environment.static_assets_middleware # rubocop:disable Lint/AssignmentInCondition
        builder.use middleware
      end

      builder.use Rack::MethodOverride
    end
@since 0.9.0
 @api private

 rubocop:disable Metrics/AbcSize
 rubocop:disable Metrics/MethodLength