fix: serve .html if no file extension in request url
This commit is contained in:
parent
3f92059269
commit
35b07cefa4
1 changed files with 4 additions and 1 deletions
5
web.py
5
web.py
|
@ -7,7 +7,10 @@ def home():
|
|||
|
||||
@app.route('/<path:path>')
|
||||
def dist(path):
|
||||
return send_from_directory('dist', path)
|
||||
if '.' in path:
|
||||
return send_from_directory('dist', path)
|
||||
else:
|
||||
return send_from_directory('dist', path + '/index.html')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0')
|
||||
|
|
Loading…
Reference in a new issue