module Middleman

def start_server(options={})

Returns:
  • (Rack::Server) -

Parameters:
  • options (Hash) -- to pass to Rack::Server.new
def start_server(options={})
  require "webrick"
  opts = {
    :Port      => options[:port] || 4567,
    :Host      => options[:host] || "0.0.0.0",
    :AccessLog => []
  }
  # opts[:Logger] = WEBrick::Log::new("/dev/null", 7) if !options[:logging]
  app_class = options[:app] ||= ::Middleman.server.inst
  opts[:app] = app_class
  # Disable for Beta 1. See if people notice.
  require "thin"
  ::Thin::Logging.silent = !options[:logging]
  opts[:server] = 'thin'
  # opts[:server] = 'webrick'
  server = ::Rack::Server.new(opts)
  server.start
  server
end