Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

阿里云部署node环境最后一步测试代码 报错 events.js:160 throw er; // Unhandled 'error' event

$
0
0

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}/); });


Viewing all articles
Browse latest Browse all 14821

Trending Articles