标签:cti 访问 run nodejs nbsp 返回 console log res
直接新建一个server.js 然后 输入以下代码
var http = require(‘http‘)
http.createServer(function(req,res){
res.writeHead(200,{‘Content-Type‘:‘text/plain‘})
res.end(‘Hello World\n‘)
}).listen(1337,‘127.0.0.1‘)
console.log(‘Server running at http://127.0.0.1:1337/‘)
之后 node server.js 运行
访问浏览器 127.0.0.1:1337
返回
Hello World
标签:cti 访问 run nodejs nbsp 返回 console log res
原文地址:http://www.cnblogs.com/QuestionsZhang/p/6616750.html