首页 > Web开发 > 详细

nodejs 2014-12-12

时间:2014-12-12 17:10:35      阅读:229      评论:0      收藏:0      [点我收藏+]

http://www.linuxidc.com/Linux/2012-10/72627.htm

see version 

node --version


helloworld.js

var http = require(‘http‘);   
server = http.createServer(function (req, res) {   
      res.writeHeader(200, {"Content-Type": "text/plain"});   
      res.end("Hello World\n");   
})   
server.listen(8000);   
console.log("httpd start @8000");


run on DOS

node helloworld.js


enter the url in explorer

http://localhost:8000/


you will see "Hello World"



nodejs 2014-12-12

原文:http://my.oschina.net/jayronwang/blog/355553

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