ECSiis
iis127.0.0.1 ip
node
80:
var http = require("http");
//
var server = http.createServer(function(req,res){
if(req.url == "/"){
//
res.writeHead(200,{"Content-Type":"text/html;charset=UTF8"});
res.end("");
}else{
res.writeHead(404,{"Content-Type":"text/html;charset=UTF8"});
res.end("");
}
});
server.listen(80,"127.0.0.1");
then run the js file through cmd. At this time, if you open 127.0.0.1 on the server, you can normally display the success message on the web page, but on the external network through http://xx.xxx.xx.xx, you will display the page with the wrong link to the website. Look at F12 and see that the request has not received any server data.
what is the reason for this, and what can be done to enable the public network to call the background data of node? Thank you first