Is there any way to pass a string with slashes in hug, for example with this function:
import hug
@hug.get("/returnfilecontent/{path}")
def doubles(path):
return open(path, 'r').read()
I want to access to http://localhost/returnfilecontent/foo/bar/myfile.md
to read contents from file located in foo/bar/myfile.md
.
It seems hug does not behave well with paths and I can only pass non-path strings like http://localhost/returnfilecontent/myfile.md