Class | Rack::Server |
In: |
lib/rack/server.rb
|
Parent: | Object |
options | [W] |
Options may include:
a rack application to run (overrides :config)
a rackup configuration file path to load (.ru)
this selects the middleware that will be wrapped around your application. Default options available are: - development: CommonLogger, ShowExceptions, and Lint - deployment: CommonLogger - none: no extra middleware note: when the server is a cgi server, CommonLogger is not included.
choose a specific Rack::Handler, e.g. cgi, fcgi, webrick
if true, the server will daemonize itself (fork, detach, etc)
path to write a pid file after daemonize
the host address to bind to (used by supporting Rack::Handler)
the port to bind to (used by supporting Rack::Handler)
webrick acess log options (or supporting Rack::Handler)
turn on debug output ($DEBUG = true)
turn on warnings ($-w = true)
add given paths to $LOAD_PATH
require the given libraries
Start a new rack server (like running rackup). This will parse ARGV and provide standard ARGV rackup options, defaulting to load ‘config.ru’.
Providing an options hash will prevent ARGV parsing and will not include any default options.
This method can be used to very easily launch a CGI application, for example:
Rack::Server.start( :app => lambda do |e| [200, {'Content-Type' => 'text/html'}, ['hello world']] end, :server => 'cgi' )
Further options available here are documented on Rack::Server#initialize