Flask serving static folder with CORS
after cors(app) add these lines:
@app.after_requestdef after_request(response): response.headers.add('Access-Control-Allow-Headers', 'Content-Type, Authorization') response.headers.add('Access-Control-Allow-Methods', 'GET, POST, PATCH, DELETE, OPTIONS') return response
Also, if using the flask-cors package, you should be able to blanket your static requests:
from flask import Flaskfrom flask_cors import CORS# Initializeapp = Flask(__name__)cors = CORS(app, resources={r"/static/*": {"origins": "*"}})
Good luck!