Flask route for AngularJS with HTML5 URL mode -
i have angularjs app being served via flask. using html5 routing mode , need redirect several urls client app. i'm not sure how wildcard matching needing correctly. match multiple levels of path this:
@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 don't , have 1 route (everything starting ui/
).
the path url converter can you:
@app.route('/ui/<path:p>') def ui(p): return app.send_static_file('index.html')
Comments
Post a Comment