【发布时间】:2013-05-14 09:04:21
【问题描述】:
我有一个通过 Flask 提供服务的 AngularJS 应用程序。我正在使用 HTML5 路由模式,因此需要将多个 URL 重定向到客户端应用程序。我不确定如何进行需要正确执行此操作的通配符匹配。目前我只匹配这样的多级路径:
@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')
显然我不喜欢这样,只想有一条路线(一切都以ui/ 开头)。
【问题讨论】: