Enable dev and domain independent serving, add favicon

This commit is contained in:
2020-12-07 21:37:41 +01:00
committed by Oskar
parent 5f296849f5
commit 99fe1e25ce
4 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,16 @@
from .app import app
from flask import send_from_directory
if __name__ == "__main__":
@app.route('/')
def get_root():
return send_from_directory('../web', 'index.html')
@app.route('/<path:path>')
def get_path(path):
return send_from_directory('../web', path)
@app.after_request
def add_headers(response):
response.headers['Access-Control-Allow-Origin'] = '*'