Try to fix cors issue

This commit is contained in:
Administrator 2022-03-16 14:47:25 +01:00
parent 72716c3c82
commit 5bb16e6d98

View File

@ -34,6 +34,14 @@ def create_app():
# interface blueprint # interface blueprint
application.register_blueprint(interface_blueprint) application.register_blueprint(interface_blueprint)
# CORS: Allow * for developing
@application.after_request # blueprint can also be app~~
def after_request(response):
header = response.headers
header['Access-Control-Allow-Headers'] = 'Content-Type'
header['Access-Control-Allow-Origin'] = '*'
return response
return application return application