【发布时间】:2018-07-24 13:57:54
【问题描述】:
我是 nodejs 的初学者,向 w3school 学习。所以以前我在 PHP 工作过。问题是,当我运行一个简单的 nodejs 程序时,命令行和 Web 浏览器中什么也没有发生
var http = require('http');
http.createServer(function(request, response) {
request.on('readable', function() {
request.read(); // throw away the data
});
request.on('end', function() {
response.writeHead(200, {
'Content-Type': 'text/plain'
});
response.end('Hello HTTP!');
});
}).listen(8080);
我已经将 xampp 服务器用于 apache。
如何在系统中同时运行。
【问题讨论】:
-
您尝试执行的命令是什么?用于更改 Xampp 服务器端口 stackoverflow.com/questions/11294812/…
-
如果端口(8080)已经分配,那么你不能使用同一个端口尝试改变你的端口并检查。