rack 1.2.2 release => Rack::Server.new(:app => app).start

37 views
Skip to first unread message

Stephen Bannasch

unread,
Aug 25, 2010, 12:24:44 PM8/25/10
to rack-...@googlegroups.com
Is a rack 1.2.2 release likely to happen soon?

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

Jeremy Hinegardner

unread,
Aug 28, 2010, 2:41:38 PM8/28/10
to rack-...@googlegroups.com
Hi all,

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

trans

unread,
Sep 25, 2010, 12:45:58 PM9/25/10
to Rack Development


On Aug 28, 2:41 pm, Jeremy Hinegardner <jer...@hinegardner.org> wrote:
> Hi all,
>
> 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

And how do you build `app` ?

James Tucker

unread,
Sep 26, 2010, 3:18:07 PM9/26/10
to rack-...@googlegroups.com

It's anything that response to #call with an env and returns a rack response style tuple [status, headers, body].

Reply all
Reply to author
Forward
0 new messages