概要:用一个最简单是例子感受一下node.js 的能力
1.代码
var http = require("http")
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(8081);
console.log('Server running at http://127.0.0.1:8081/');
2.运行结果
2.1 node t.js

1.2 http://127.0.0.1:8081

博客通过一个简单例子展示Node.js能力,给出相关代码,并呈现运行结果,包括在命令行执行‘node t.js’以及访问‘http://127.0.0.1:8081’。

被折叠的 条评论
为什么被折叠?



