Sha256: babb7ed2c1d359b01de8d92a584f28581339594b611aef9afd624a002e06baf4

Contents?: true

Size: 327 Bytes

Versions: 2

Compression:

Stored size: 327 Bytes

Contents

# frozen_string_literal: true

class Async::App::WebServer::Router
  extend Async::App::Injector

  def initialize(*apps)
    @apps = apps
  end

  def call(request)
    @apps.each { return Protocol::HTTP::Response[*_1.call(request)] if _1.can_handle?(request) }

    Protocol::HTTP::Response[404, {}, ["Not found"]]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
async-tools-0.2.9 lib/async/app/web_server/router.rb
async-tools-0.2.8 lib/async/app/web_server/router.rb