diff options
-rw-r--r-- | lib/yahns/rackup_handler.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/yahns/rackup_handler.rb b/lib/yahns/rackup_handler.rb index 9fbebbf..356caaf 100644 --- a/lib/yahns/rackup_handler.rb +++ b/lib/yahns/rackup_handler.rb @@ -11,6 +11,10 @@ module Yahns::RackupHandler # :nodoc: def self.run(app, o) cfg = Yahns::Config.new cfg.instance_eval do + # we need this because "rackup -D" sends us to "/", which might be + # fine for most apps, but we have SIGUSR2 restarts to support + working_directory(Yahns::START[:cwd]) + app(:rack, app) do addr = o[:listen] || "#{o[:Host]||default_host}:#{o[:Port]||8080}" # allow listening to multiple addresses @@ -31,10 +35,6 @@ module Yahns::RackupHandler # :nodoc: x = x.to_sym val = o[x] and __send__(x, val) end - - # we need this because "rackup -D" sends us to "/", which might be - # fine for most apps, but we have SIGUSR2 restarts to support - working_directory(Yahns::START[:cwd]) end Yahns::Server.new(cfg).start.join end |