nodejs服务器搭建模块
const http=require("http"); var server= http.createServer((req,res)=>{ if(req.url!="/favicon.ico"){ res.writeHead(200,{ "content-type":"text/html;charset=utf-8","Access-Control-Allow-Origin":"*" }); res.write("a"); res.end(); } }) server.listen(8000); console.log("服务器开启,地址为:127.0.0.1:8000")