- Install package flask-cors
pip install flask-cors
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route("/")
def home():
return "Hello, cross-origin-world!"
if __name__=='__main__':
app.run(debug=True)