# class Rack::Handler::Thin

### Public Class Methods

run(app, **options) { |server| ... } click to toggle source

    # File lib/rack/handler/thin.rb, line 11
    def self.run(app, **options)
      environment  = ENV['RACK_ENV'] || 'development'
      default_host = environment == 'development' ? 'localhost' : '0.0.0.0'

      host = options.delete(:Host) || default_host
      port = options.delete(:Port) || 8080
      args = [host, port, app, options]
      server = ::Thin::Server.new(*args)
      yield server if block_given?
      server.start
    end

valid_options() click to toggle source

    # File lib/rack/handler/thin.rb, line 23
    def self.valid_options
      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: 8080)",
      }
    end