I wrote a cgi script in python, which is for drawing and needs to get data from the front end, but js directly calls the python cgi service, cross-domain, and does not find a way to deal with it.
nodesuperagentjsnodenodepython
app.post("/getdata",function(req,res){
var data = req.body;
// console.log(data);
// res.send({msg:"success"});
if(data){
superagent
.post("http://10.172.14.39:8000/cgi-bin/ft.py").send(data)
.end(function(req,res){
console.log(res);
console.log(req);
});
}
})
now the problem is that the node cannot receive the value returned by python, and the printed res,req output is as follows:
python:
excuse me, what is the cause, how to solve the problem, or how to solve the cross-domain problem of front-end calling python cgi services?