Flask Fetch请求502登录时网关错误

Flask Fetch请求502登录时网关错误,flask,fetch,bad-gateway,Flask,Fetch,Bad Gateway,我目前正在尝试在登录web应用程序时执行提取请求,但我一直收到一个请求 87466804-e84d-413e-abd1-74dc56624149-ide.cs50.xyz/sell:1 Failed to load resource: the server responded with a status of 502 (Bad Gateway) 然后 sell:1 Access to fetch at 'http://87466804-e84d-413e-abd1-74dc56624149-i

我目前正在尝试在登录web应用程序时执行提取请求,但我一直收到一个请求

87466804-e84d-413e-abd1-74dc56624149-ide.cs50.xyz/sell:1 Failed to load resource: the server responded with a status of 502 (Bad Gateway)
然后

sell:1 Access to fetch at 'http://87466804-e84d-413e-abd1-74dc56624149-ide.cs50.xyz/sell' from origin 'http://127.0.0.1:5000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
我的烧瓶应用程序看起来像

@app.route("/sell", methods=["GET", "POST"])
@login_required
def sell():
    ticker_symbols = helper_index.get_ticker_symbols(currently_owned_table)

    #handles GET request
    if request.method == "GET":
        return render_template("sell.html", companies=ticker_symbols)

    if request.method == "POST":

        #handles submitted form
        if "sell_form" in request.form:
            #if form is submitted


            return "thanks"

        #handles fetch request
        else:
            the_request = request.get_json()
            the_symbol = [the_request["symbol"]]
            shares_available = helper_index.get_total_shares(the_symbol, currently_owned_table)
            requested_shares = the_request["shares"]

            print(requested_shares)

            if int(requested_shares) <= shares_available[0]:
                return "true"
            else:
                return "false"

@app.route(“/sell”,methods=[“GET”,“POST”])
@需要登录
def sell():
ticker\u symbols=helper\u index.get\u ticker\u symbols(当前拥有的表)
#处理GET请求
如果request.method==“GET”:
返回渲染模板(“sell.html”,companys=ticker\u符号)
如果request.method==“POST”:
#处理提交的表格
如果request.form中的“sell_form”:
#如果提交了表格
回复“谢谢”
#处理提取请求
其他:
请求=request.get\u json()
_符号=[_请求[“符号”]]
shares\u available=helper\u index.get\u total\u shares(共享符号,当前拥有的表)
请求的共享=请求[“共享”]
打印(请求的共享)
如果int(请求的_共享)有魔力

app.py

app = Flask(__name__)
cors = CORS(app, resources={r"/*": {"origins": "*"}})

@app.route("/api/v1/users")
    def list_users():
    return "user example"