Loading... 到NodeJS官网下载安装稳定版。 选择一款IDE,我选用的是Webstorm app.js: var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<h1>Node.js</h1>'); res.end('<p>Hello World</p>'); }).listen(3000); console.log("HTTP server is listening at port 3000."); 在命令行中键入node app.js 访问http://127.0.0.1:3000 顺利的话会在浏览器中显示如下内容: ![hello.png][1] [1]: http://blog.pingchas.com/usr/uploads/2018/01/3648297316.png Last modification:September 27, 2018 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏