从零开始学习Node.js例子零 永远的Hello World

时间:2014-04-02 12:19:41   收藏:0   阅读:470

index.js

bubuko.com,布布扣
var http = require("http");

http.createServer(function(request, response) {  
    response.writeHead(200, {"Content-Type": "text/plain"});  
    response.write("Hello World");  
    response.end();
}).listen(8888);

console.log("nodejs start listen 8888 port!");
bubuko.com,布布扣

 

result:

bubuko.com,布布扣

bubuko.com,布布扣

从零开始学习Node.js例子零 永远的Hello World,布布扣,bubuko.com

原文:http://www.cnblogs.com/EricaMIN1987_IT/p/3640312.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!