接触Node时,发现其中的http模块能够创建http服务器,并且使web小项目快速跑起来
var http=require("http");
var fs=require("fs");
var data=fs.readFileSync("VueJs/vue_1.html");
http.createServer(function (resquest,response) {
response.write('<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>Hello</title>\n' +
'</head>');
response.end('<body>\n' +
'<h1>这是Node.js的Http响应</h1>\n' +
'<p>我认为这是比较ok</p>\n' +
'</body>\n' +
'</html>');
}).listen(8899,'127.0.0.1');
console.log("on the ok");