[Node.js] 建立網頁伺服器(new a web server)

1、new a file called my-web-server.js, and contents of file is following:

var http = require('http');
var serv = http.createServer(function(req, res){
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('<marquee>Smashing Node!</marquee>');
});
serv.listen(3000);

2、run the file:

$ node my-web-server.js

3、Then you can see the page on http://localhost:3000