Class: Mainline::Server
- Inherits:
-
Object
- Object
- Mainline::Server
- Defined in:
- lib/mainline/server.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
Constructor Details
#initialize(config) ⇒ Server
Returns a new instance of Server.
3 4 5 |
# File 'lib/mainline/server.rb', line 3 def initialize(config) @config = config end |
Instance Method Details
#start ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mainline/server.rb', line 7 def start = {:Port => @config.port, :Host => "0.0.0.0"} @server = Rack::Handler::WEBrick require RAILS_ROOT + "/config/environment" inner_app = ActionController::Dispatcher.new inner_app.send(:build_middleware_stack) app = Rack::Builder.new { run inner_app }.to_app @server.run(app, .merge(:AccessLog => [])) end |