如何在CentOS和RHEL上安装最新的Nodejs


当前第2页 返回上一页

1

# vim demo_server.js

并添加以下内容

1

2

3

4

5

6

var http = require('http');

http.createServer(function (req, res) {

  res.writeHead(200, {'Content-Type': 'text/plain'});

  res.end('Welcome Node.js');

}).listen(3001, "127.0.0.1");

console.log('Server running at http://127.0.0.1:3001/');

现在使用命令启动Web服务器。

1

2

3

4

# node --debug demo_server.js

 

debugger listening on port 5858

Server running at http://127.0.0.1:3001/

Web服务器已在端口3001上启动。现在在浏览器中访问http://127.0.0.1:3001/url。

本篇文章到这里就已经全部结束了,更多其他精彩内容可以关注PHP中文网的Linux视频教程栏目!

以上就是如何在CentOS和RHEL上安装最新的Nodejs的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

centos无法获取ip怎么办

centos系统连接网络不可达怎么办

centos环境中怎么自定义网桥

centos如何下载文件

centos修改root密码的方法

centos启动mysql失败的解决方法

centos怎么重启网卡

centos下安装chrome浏览器后打不开怎么办

centos如何修改ip

centos 8 将停止维护了!

更多相关阅读请进入《nodejs》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...