|
|
@ -74,12 +74,12 @@ def catch_source(path): |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/') |
|
|
|
@app.route('/') |
|
|
|
@app.route('/<path:path>') |
|
|
|
@app.route('/<path:path>') |
|
|
|
def catch_all(path='index.html'): |
|
|
|
def catch_all(path='index.html', context=None): |
|
|
|
"""Catch-all function which serves every URL.""" |
|
|
|
"""Catch-all function which serves every URL.""" |
|
|
|
|
|
|
|
context = context or {} |
|
|
|
if not os.path.splitext(path)[1]: |
|
|
|
if not os.path.splitext(path)[1]: |
|
|
|
path = os.path.join(path, 'index.html') |
|
|
|
path = os.path.join(path, 'index.html') |
|
|
|
return render_template(path) |
|
|
|
return render_template(path, **context) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
if __name__ == "__main__": |
|
|
|