以前搞过一段时间的node,几个月不用,又忘记了...T_T;

准备重新学一下,再做几个项目.现在Node的版本是0.10.12,下载地址是http://nodejs.org;

在cmd里

我的node装在E盘:
-> e:
-> cd node
-> node xxx.js

 

//先搭建一个http服务器

var http = require('http');

http.createServer(function(req,res){
  res.writeHead(200,'text/html');  //响应头
  res.write('<p>Hello Node</p>');  //响应内容
  res.end();              //响应结束
}).listen(3000)

console.log('http server is listening at 3000 port');

 

 

...时间原因没完结

Posted on 2013-06-26 22:01  SmileCN  阅读(245)  评论(0编辑  收藏  举报