Skip to content

Instantly share code, notes, and snippets.

@clyfe
Created November 1, 2010 08:07
Show Gist options
  • Save clyfe/657808 to your computer and use it in GitHub Desktop.
Save clyfe/657808 to your computer and use it in GitHub Desktop.
rackup dav4rack above session middleware
# 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