Sha256: 3ce470510d72af8f790e44b6842f0256057d0ffd6b84ab804baab5b0bb2c48a6
Contents?: true
Size: 581 Bytes
Versions: 7
Compression:
Stored size: 581 Bytes
Contents
require 'rack/handler' require_relative '../../falcon' require 'async/io/host_endpoint' module Rack module Handler module Falcon def self.endpoint_for(**options) host = options[:Host] || 'localhost' port = Integer(options[:Port] || 9292) return Async::IO::Endpoint.tcp(host, port) end def self.run(app, **options) endpoint = endpoint_for(**options) server = ::Falcon::Server.new(::Falcon::Adapters::Rack.new(app), endpoint) Async::Reactor.run do server.run end end end register :falcon, Falcon end end
Version data entries
7 entries across 7 versions & 1 rubygems