Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Kirk adapter and example to use the configurator.

  • Loading branch information...
commit 338e7df173aafdb3b4cced7ef8ed35807db70e80 1 parent bc03168
@bernd bernd authored
Showing with 10 additions and 3 deletions.
  1. +6 −1 examples/kirk.rb
  2. +4 −2 lib/webmachine/adapters/kirk.rb
View
7 examples/kirk.rb
@@ -17,5 +17,10 @@ def to_html
Webmachine::Dispatcher.add_route([], HelloResource)
-Webmachine.adapter = :Kirk
+Webmachine.configure do |config|
+ config.ip = '127.0.0.1'
+ config.port = 5000
+ config.adapter = :Kirk
+end
+
Webmachine.run
View
6 lib/webmachine/adapters/kirk.rb
@@ -12,9 +12,11 @@ module Adapters
# An adapter for the kirk JRuby webserver.
module Kirk
def self.run
+ c = Webmachine.configuration
+
connector = ::Kirk::Jetty::SelectChannelConnector.new.tap do |conn|
- conn.set_host('0.0.0.0')
- conn.set_port(3000)
+ conn.set_host(c.ip)
+ conn.set_port(c.port)
end
server = ::Kirk::Server.new(Handler.new, :connectors => [connector])
Please sign in to comment.
Something went wrong with that request. Please try again.