Skip to content

Instantly share code, notes, and snippets.

@clyfe
Created November 1, 2010 08:12
Show Gist options
  • Save clyfe/657811 to your computer and use it in GitHub Desktop.
Save clyfe/657811 to your computer and use it in GitHub Desktop.
rackup dav4rack custom stack
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
use ActionDispatch::Static
use Rack::Lock
use ActiveSupport::Cache::Strategy::LocalCache
use Rack::Runtime
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::RemoteIp
use Rack::Sendfile
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use Rack::MethodOverride
use ActionDispatch::Head
use ActionDispatch::BestStandardsSupport
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.routes
end
}.to_app
run app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment