Created
April 16, 2010 14:26
-
-
Save dokipen/368462 to your computer and use it in GitHub Desktop.
Deprecated usher file mounting
This file contains 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
# 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