0

Is it possible to put PATH like this text/text.txt into URL parameter in Flask ?
It is important that it contains PATH with slash and dot.

@app.route('/<path>')
def getPath(path):
    return path
wondergrandma
  • 103
  • 1
  • 12

1 Answers1

2

If you use variable rules with the prefix path your requirements should be met.

@app.route('/<path:filename>')
def getPath(filename):
    return filename
Detlef
  • 6,137
  • 2
  • 6
  • 24