数字海洋部署-node.js app(在ip上运行,但不在域上运行)

时间:2017-05-01 12:14:50

标签: node.js digital-ocean

我正在尝试在digitalocean上部署我的node.js应用。当我在ip上打开它时 107.170.16.24:3000,它完全打开。

但是,当我在像.connect.io这样的域名上打开它时。我明白了

This site can’t be reached

www.theconnect.io took too long to respond.

我检查过名字服务器,看起来还不错。有人能告诉我哪里出错了吗?即使我知道错误来源,我也可以纠正它。但是,现在我很困惑,我应该在哪里寻找错误。

当我连接我的ubuntu终端并运行" nodemon"命令。它运行完美,并向我显示像

这样的文字
root@nodejs-512mb-nyc2-01:~/poppop2# nodemon
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./bin/www`
in dir routes / index
moving to 404
onListening now
Db Connected

因此,就应用程序而言,它看起来一切正常。当我输入域名theconnect.io

时,有人能告诉我为什么它不会打开

1 个答案:

答案 0 :(得分:0)

我刚解决了。所以,我会在这里发布我的答案。我将端口更改为80并且工作正常。以前,它是3000.现在,它的工作原理。感谢