📜  向用户节点发送数据 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:01.230000             🧑  作者: Mango

代码示例1
var http = require('http');
var data = "data to send to client";
var server = http.createServer(function (request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write(data); // You Can Call Response.write Infinite Times BEFORE response.end
    response.end("Hello World\n");
}).listen(8080);