Method: Wee.run
- Defined in:
- lib/wee.rb
.run(component_class = nil, mount_path = '/', port = 2000, &block) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/wee.rb', line 38 def Wee.run(component_class=nil, mount_path='/', port=2000, &block) raise ArgumentError if component_class and block require 'rack/handler/webrick' app = Rack::Builder.app do map mount_path do if block run Wee::Application.new(&block) else run Wee::Application.new { Wee::Session.new(component_class.new) } end end end Rack::Handler::WEBrick.run(app, :Port => port) end |