Class: Ramaze::Adapter::WEBrick
- Defined in:
- lib/ramaze/adapter/webrick.rb
Overview
Our WEBrick adapter acts as wrapper for the Rack::Handler::WEBrick.
Class Method Summary collapse
-
.run_server(host, port, options = {}) ⇒ Object
start server on given host and port, see below for possible options.
Methods inherited from Base
before, before_call, call, middleware_respond, respond, start, stop
Class Method Details
.run_server(host, port, options = {}) ⇒ Object
start server on given host and port, see below for possible options.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ramaze/adapter/webrick.rb', line 14 def run_server host, port, = {} = { :Port => port, :BindAddress => host, :Logger => Log, :AccessLog => [ [Log, ::WEBrick::AccessLog::COMMON_LOG_FORMAT], [Log, ::WEBrick::AccessLog::REFERER_LOG_FORMAT] ] }.merge() server = ::WEBrick::HTTPServer.new() server.mount("/", ::Rack::Handler::WEBrick, self) thread = Thread.new(server) do |adapter| Thread.current[:adapter] = adapter adapter.start end end |