2011/12/16 Bartosz Dziewoński <matma....@gmail.com>:
> I usually just use Rack::Static:
>
> module App
>  use Rack::Static, :urls => ['/static']
> end
>
> This would serve ./static/jquery.js at
> localhost:3301/static/jquery.js, though - with the directory included
> in URL - but will also serve files from subdirectories recursively (I
> don't know if Rack::File does this).

Yeah, that works, but I hate how /static/ is needed in the URL. The
only reason Before is actually needed is because no-one in Rack
thought of creating a Rack::File-ish middleware. Rack::Cascade works
nice, but it can't be used as a middleware. This simply turns
Rack::Cascade into a middleware.
_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to