Skip to content

Instantly share code, notes, and snippets.

@dokipen
Created April 16, 2010 14:26
Show Gist options
  • Save dokipen/368462 to your computer and use it in GitHub Desktop.
Save dokipen/368462 to your computer and use it in GitHub Desktop.
Deprecated usher file mounting
# I'm using this
base = File.expand_path(File.join(File.dirname(__FILE__)))
app = Rack::File.new(base)
routes = Usher::Interface.for(:rack) do
add("/static/(js|css|img)/:file").to(app)
end
# It would be nice to use this. I made the paths different
# to illustrate the need to strip off the first part of the
# path info before sending to Rack::File. I've avoided that
# in my current solution.
routes = Usher::Interface.for(:rack) do
add_static("/static1").from("/static2")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment