mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
20 lines
476 B
Ruby
20 lines
476 B
Ruby
require 'rainbows'
|
|
|
|
module Rack
|
|
module Handler
|
|
class Rainbows
|
|
def self.run(app, **options)
|
|
rainbows_options = {
|
|
listeners: ["#{options[:Host]}:#{options[:Port]}"],
|
|
worker_processes: 1,
|
|
timeout: 30,
|
|
config_file: ::File.expand_path('rainbows.conf', __dir__),
|
|
}
|
|
|
|
::Rainbows::HttpServer.new(app, rainbows_options).start.join
|
|
end
|
|
end
|
|
|
|
register :rainbows, ::Rack::Handler::Rainbows
|
|
end
|
|
end
|