I'd like to be able to use Rack::Server by passing in an app instead of specifying a config.ru.
I just fixed it by hackingmy rack-1.2.1 gem locally and then saw this commit on July 12:
http://github.com/rack/rack/commit/c73b474525bace3f059a130b15413abd4d917086
Rack::Server should accept :app and override :config.
I want to be able to do things like this:
jnlp_app = Rack::Builder.new do
map "/" do
use Rack::Jnlp
run Rack::Directory.new(PUBLIC_DIR)
end
end
Rack::Server.new(:app => jnlp_app, :Port => 4321, :server => 'webrick').start
Which I can now on my machine or if I update to the tip of the master branch.
I'd just like it to be easier to deploy the code on the server or share with other people.
In the meantime I'm using this form:
Rack::Handler::WEBrick.run(jnlp_app, :Port => 4321)
But starting the server that way doesn't respond to ctrl-c ... see: http://github.com/rack/rack/issues/issue/35
I too would like to use Rack::Server by passing in an app.
For the moment I'm working around it with:
server = ::Rack::Server.new( options )
server.instance_variable_set('@app', options[:app] )
server.start
enjoy,
-jeremy
--
========================================================================
Jeremy Hinegardner jer...@hinegardner.org
It's anything that response to #call with an env and returns a rack response style tuple [status, headers, body].