var http = require("http");
http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }).listen(8888);
上面这段代码写在index.JS 里是不是表示每次有一个用户来访问都会createServer 生成一个http服务器,这样很多人来访问就会有很多服务器产生。但是像appach 就只有一个服务器。node这样只不是很浪费资源。