Module: Rackup::Handler::Cougar

Defined in:
lib/rackup/handler/cougar.rb

Class Method Summary collapse

Class Method Details

.run(app, **options) {|server| ... } ⇒ Object

Yields:

  • (server)


8
9
10
11
12
13
14
15
# File 'lib/rackup/handler/cougar.rb', line 8

def self.run(app, **options)
  host = options[:Host] || "localhost"
  port = Integer(options[:Port] || 9292)

  server = ::Cougar::Server.new(app, host: host, port: port)
  yield server if block_given?
  server.run
end

.valid_optionsObject



17
18
19
20
21
22
# File 'lib/rackup/handler/cougar.rb', line 17

def self.valid_options
  {
    "Host=HOST" => "Hostname to listen on (default: localhost)",
    "Port=PORT" => "Port to listen on (default: 9292)"
  }
end