Skip to content
Snippets Groups Projects
Commit 4dcc3509 authored by Thomas Roos's avatar Thomas Roos
Browse files

Neater way of doing the fallback in Flask

parent 6468ac7c
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,6 @@ app.register_blueprint(api.app, url_prefix='/api')
@app.route('/')
@app.route('/<file>')
def index(file=''):
if (isfile(path.join(static_folder_path, file))):
return app.send_static_file(file)
else:
return app.send_static_file('index.html')
\ No newline at end of file
if not isfile(path.join(static_folder_path, file)):
file = 'index.html'
return app.send_static_file(file)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment