1. 初识node

1.执行node hello.js开启服务器,然后在浏览器输入127.0.0.1:8888, 页面显示helloworld

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/');
原文地址:https://www.cnblogs.com/bravolove/p/6061315.html