NodeJs入门------第一个demo

在文件夹E:\softstall\nodejs\mynodeExamples下面建文件测试hello.js


var http = require("http");  
http.createServer(function(request, response) {  
    response.writeHead(200, {"Content-Type": "text/html"});  
    response.write("Hello World!");  
    response.end();  
}).listen(8080);  
console.log("Server running at http://localhost:8080/");  


然后运行该文件:


访问浏览器





你可能感兴趣的:(nodejs)