1、下载node for mac并一路默认安装
2、测试成功否
3、copy this file to test(save as javascript file)
var http = require('http'); http.createServer(function(request,response){ response.writeHead(200,{'Content-Type':'text/plain'}); response.end('hello world '); }).listen(8888); console.log('Server running at http://127.0.0.1:8888/');
cd到正确路径下
打开浏览器,出现输入地址和端口号
yeah you succeed!