5fcda5e5b1c6c5351.png_fo742.png

#pip install flask-cors
from flask import Flask, jsonify
from flask_cors import CORS

app = Flask(__name__)
CORS(app, supports_credentials=True)

@app.route("/data")
def data():
    products = [
        {"k": "test1", "v": 1},
        {"k": "test2", "v": 2},
    ]
    return jsonify(products)

if __name__ == '__main__':
    app.run()

发表评论

您的电子邮箱地址不会被公开。

Captcha Code