nodejs报错

来源:互联网 发布:广播剧后期制作软件 编辑:程序博客网 时间:2024/05/18 01:02


端口3000已被使用,换成其他(比如4000),就可以了。

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, Good Morning!</p>');    }).listen(4000);console.log("HTTP server is listening at port 4000.");

监听端口改为4000,在浏览器中输入http://localhost:4000/,显示:


0 0
原创粉丝点击