lib/jobim/server.rb in jobim-0.4.7 vs lib/jobim/server.rb in jobim-0.4.8
- old
+ new
@@ -4,11 +4,11 @@
module Jobim::Server
def self.start(opts)
app = Rack::Builder.new do
use Rack::Rewrite do
- rewrite %r{(.*)}, lambda do |match, env|
+ rewrite(%r{(.*)}, lambda do |match, env|
request_path = env["REQUEST_PATH"]
return match[1] if opts[:Prefix].length > request_path.length
local_path = File.join(opts[:Dir], request_path[opts[:Prefix].length..-1])
@@ -17,10 +17,10 @@
File.exists?(File.join(local_path, "index.html"))
File.join(request_path, "index.html")
else
match[1]
end
- end
+ end)
end
use Rack::CommonLogger, STDOUT
map opts[:Prefix] do