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}/
);
});
↧
阿里云部署node环境最后一步测试代码 报错 events.js:160 throw er; // Unhandled 'error' event
↧