没想到啊

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

node.js 编写的一个简单的 HTTP 服务器

1 var http = require('http');
2 server = http.createServer(function (req, res) {
3 res.writeHeader(200, {"Content-Type": "text/plain"});
4 res.end("Hello oschina\n");
5 })
6 server.listen(8000);
7 console.log("httpd start @8000");

 

posted on 2011-11-22 16:25  没想到啊  阅读(201)  评论(0)    收藏  举报