请确保你本地正确安装nodejs.
首先,我们找到nodejs的安装位置
2.进去后,创建新的文件,test.js
3.test.js内容为:
var http = require('http');
server = http.createServer(function (req, res) {
var html = '<html>'
+'<head>'
+'<title>nodejs</title>'
+'</head>'
+'<body><h1>'
+ 'hello world!--by guosp'
+'</h1></body>'
+'</html>';
res.writeHeader(200, {"Content-Type&#