【app.py】添加路由拦截器:错误路径跳转404

This commit is contained in:
戒酒的李白
2024-07-03 00:31:12 +08:00
parent ef1d471a30
commit 38dd6686d5
+4
View File
@@ -6,5 +6,9 @@ app = Flask(__name__)
def hello_world(): # put application's code here
return session.clear()
@app.route('/<path:path>')
def catch_all(path):
return render_template('404.html')
if __name__ == '__main__':
app.run()