阿里云部署node环境最后一步测试代码 报错 events.js:160 throw er; // Unhandled 'error' event
const http = require(‘http’);
const hostname = ‘ECS公网IP地址’;
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader(‘Content-Type’, ‘text/plain’);
res.end(‘Hello World\n’);
});
server.listen(port, hostname, () => {
console.log(Server running at http://${hostname}:${port}/
);
});
2 回复
server.listen(port, hostname, () => { 这里的hostname能告诉我什么意思吗?有什么存在意义?
调用栈呢?