Created
March 18, 2013 17:22
-
-
Save patrickkettner/5189012 to your computer and use it in GitHub Desktop.
bottle (python web framework) serve nested static files
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 don't know why, but this took me forever to figure out. | |
you just need to match .* and then serve it out of a root folder | |
with a matching file structure to the request. | |
leaving this here for the next time I need to roll something from scratch | |
""" | |
@route('/static/<filename:re:.*>') | |
def server_static(filename): | |
return static_file(filename, root='./static') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you :)