Permalink
Browse files

More thorough Sinatra example

  • Loading branch information...
1 parent e4ba79a commit 08951ebef3b13a73c0ae19a0b6fa895a6c5c5f30 Nathan Duran committed Apr 9, 2011
Showing with 12 additions and 4 deletions.
  1. +11 −3 example/sinatra/config.ru
  2. +1 −1 example/sinatra/mongrel2.conf
@@ -1,8 +1,16 @@
-$: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
-$:.unshift(File.expand_path('.')) # Ruby 1.9 doesn't have . in the load path...
+#Setup your own load paths here
+$LOAD_PATH.push(File.expand_path(File.dirname(__FILE__)))
require 'rack/handler/mongrel2'
require 'app'
-Rack::Handler::Mongrel2.run Sinatra::Application, :uuid => 'sinatra', :block => true
+#The connection specs are NOT optional, and they must
+#be the opposite of what you declared in the Mongrel
+#config--so 'recv' connects to 'send' and vice-versa.
+Rack::Handler::Mongrel2.run( Sinatra::Application,
+ :recv => "tcp://127.0.0.1:9997",
+ :send => "tcp://127.0.0.1:9996",
+ :uuid => "B811AAB7-F7AD-4E2E-B755-8B1E7E52317F",
+ :block => true)
+
exit(0)
@@ -1,6 +1,6 @@
darkblog2 = Host(name='localhost', routes={
'/': Handler(send_spec='tcp://127.0.0.1:9997',
- send_ident='sinatra',
+ send_ident='B811AAB7-F7AD-4E2E-B755-8B1E7E52317F',
recv_spec='tcp://127.0.0.1:9996',
recv_ident='')
})

0 comments on commit 08951eb

Please sign in to comment.