首页 > Web开发 > 详细

学习nodejs之hello world

时间:2015-09-06 16:25:56      阅读:108      评论:0      收藏:0      [点我收藏+]
var http = require(‘http‘); //引用名称控件

server = http.createServer(function(req,res) {
    res.writeHead(200,{‘Content-Type‘:‘text/plain‘});
    res.end(‘hello world!‘);
}); //创建http server

server.listen(8000); //监听8000端口

console.log(‘httpd start @8000‘)


学习nodejs之hello world

原文:http://my.oschina.net/u/2351685/blog/501779

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!