use rainbows instead of puma in examples
This commit is contained in:
parent
4b502e0ec6
commit
2bbbad0289
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env ruby -I ../lib -I lib
|
||||
# coding: utf-8
|
||||
require_relative 'rainbows'
|
||||
require 'sinatra'
|
||||
set :server, 'puma'
|
||||
set :server, :rainbows
|
||||
connections = []
|
||||
|
||||
get '/' do
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
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
|
|
@ -8,13 +8,13 @@ module Rack
|
|||
listeners: ["#{options[:Host]}:#{options[:Port]}"],
|
||||
worker_processes: 1,
|
||||
timeout: 30,
|
||||
config_file: ::File.expand_path('../rainbows.conf', __FILE__),
|
||||
config_file: ::File.expand_path('rainbows.conf', __dir__),
|
||||
}
|
||||
|
||||
::Rainbows::HttpServer.new(app, rainbows_options).start.join
|
||||
end
|
||||
end
|
||||
|
||||
register "rainbows", "Rack::Handler::Rainbows"
|
||||
register :rainbows, ::Rack::Handler::Rainbows
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue