Created
November 1, 2010 08:07
-
-
Save clyfe/657808 to your computer and use it in GitHub Desktop.
rackup dav4rack above session middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
WEBDAV_MOUNT_PATH = '/webdav' | |
app = Rack::Builder.new { | |
map WEBDAV_MOUNT_PATH + '/' do | |
run DAV4Rack::Handler.new( | |
:root => Rails.root.to_s, | |
:root_uri_path => WEBDAV_MOUNT_PATH, | |
:resource_class => ::DAV4Rack::FileResource | |
) | |
end | |
map '/' do | |
use DAV4Rack::Interceptor, :mappings => { | |
WEBDAV_MOUNT_PATH + '/' => { | |
:resource_class => ::DAV4Rack::FileResource | |
}, | |
} | |
run RailsDav::Application | |
end | |
}.to_app | |
run app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment