Sha256: 9205d7a749ba2bb8a4b3d36bd9e979b1bf1956401fd272b479adc0e8f2242d23

Contents?: true

Size: 517 Bytes

Versions: 5

Compression:

Stored size: 517 Bytes

Contents

require 'rack/handler'

require_relative '../../falcon'

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(app, endpoint)
				
				Async::Reactor.run do
					server.run
				end
			end
		end
		
		register :falcon, Falcon
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
falcon-0.12.0 lib/rack/handler/falcon.rb
falcon-0.11.0 lib/rack/handler/falcon.rb
falcon-0.10.0 lib/rack/handler/falcon.rb
falcon-0.9.0 lib/rack/handler/falcon.rb
falcon-0.8.0 lib/rack/handler/falcon.rb