fix: serve .html if no file extension in request url

This commit is contained in:
Ayo Ayco 2024-04-08 20:10:32 +02:00
parent 3f92059269
commit 35b07cefa4

3
web.py
View file

@ -7,7 +7,10 @@ def home():
@app.route('/<path:path>') @app.route('/<path:path>')
def dist(path): def dist(path):
if '.' in path:
return send_from_directory('dist', path) return send_from_directory('dist', path)
else:
return send_from_directory('dist', path + '/index.html')
if __name__ == '__main__': if __name__ == '__main__':
app.run(host='0.0.0.0') app.run(host='0.0.0.0')