nodejs初探(二)第一个nodejs程序“hello world”

样例地址http://www.lxrtalk.com/

直接用文本编辑器编写helloworld.js,保存在桌面

var http = require("http");
http.createServer(function(request, response) {   
    response.write("Hello World");  
    response.end();
}).listen(8080);
console.log("nodejs start listen 8080 port!");

  

在浏览器中访问http://localhost:8088/

会看到显示

Hello World
posted @ 2015-12-12 11:02  然然1907  阅读(223)  评论(0编辑  收藏  举报