Class: WebSystem::ThinServerRack::ThinHandler
- Inherits:
-
Object
- Object
- WebSystem::ThinServerRack::ThinHandler
- Defined in:
- lib/web_system/sub/rack/server_racks/thin_server_rack.rb
Overview
NOTE: I don’t know why the file below is not included in the gem. github.com/macournoyer/thin/blob/master/lib/rack/handler/thin.rb
Class Method Summary collapse
Class Method Details
.run(app, **options) {|server| ... } ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/web_system/sub/rack/server_racks/thin_server_rack.rb', line 31 def self.run(app, **) environment = ENV['RACK_ENV'] || 'development' default_host = environment == 'development' ? 'localhost' : '0.0.0.0' host = .delete(:Host) || default_host port = .delete(:Port) || 3000 args = [host, port, app, ] server = ::Thin::Server.new(*args) yield server if block_given? server.start end |
.valid_options ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/web_system/sub/rack/server_racks/thin_server_rack.rb', line 45 def self. environment = ENV['RACK_ENV'] || 'development' default_host = environment == 'development' ? 'localhost' : '0.0.0.0' { "Host=HOST" => "Hostname to listen on (default: #{default_host})", "Port=PORT" => "Port to listen on (default: 3000)", } end |