from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app, resources=r'/*')
@app.route('/')
def hello_world():
return {'hello': 'world!'}
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
参考: https://www.cnblogs.com/maplesnow/p/11906473.html