I have an AngularJS application through Flask. I am using HTML5 routing mode and therefore it is necessary to redirect multiple URLs to the client application. I am not sure how to make a wildcard requiring it to be done correctly. Currently, I am simply mapping several levels of the path as follows:
@app.route('/ui/') def ui(): return app.send_static_file('index.html') @app.route('/ui/<path>') def ui(path): return app.send_static_file('index.html') @app.route('/ui/<path>/<path2>') def ui(path,path2): return app.send_static_file('index.html')
Obviously, I don't like this, and I just need one route (everything starting with ui/ ).
source share