feat: handle error 404
This commit is contained in:
parent
35b07cefa4
commit
ec771521f5
1 changed files with 5 additions and 0 deletions
5
web.py
5
web.py
|
@ -12,5 +12,10 @@ def dist(path):
|
||||||
else:
|
else:
|
||||||
return send_from_directory('dist', path + '/index.html')
|
return send_from_directory('dist', path + '/index.html')
|
||||||
|
|
||||||
|
@app.errorhandler(404)
|
||||||
|
def not_found(e):
|
||||||
|
return send_from_directory('dist', '404.html')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0')
|
app.run(host='0.0.0.0')
|
||||||
|
|
Loading…
Reference in a new issue