1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
sinatra/examples/rainbows.rb

21 lines
476 B
Ruby
Raw Normal View History

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