Sha256: 46fcadcf1fc1ca435b41ca96354310e952ea1d47ff47873d12360c609787826b

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

require "rack"

module Nutcracker
  module Web
    def self.start(nutcracker, options = {})
      $nutcracker = nutcracker
      @thread = Thread.new do
        Thread.current.abort_on_exception=true
        Rack::Server.start(
          {
            :app => Nutcracker::Web::App,
            :environment => 'production',
            :pid => nil,
            :Port => 9292,
            :Host => '0.0.0.0',
            :AccessLog => []
          }.merge( options )
        )
      end
      self
    end
    
    def self.stop
      @thread.kill
    end

    autoload :App, 'nutcracker/web/app'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nutcracker-web-0.0.2 lib/nutcracker/web.rb