[英]Node.js app in Heroku crashes when I close the cmd
I'm running a node.js app using Heroku. 我正在使用Heroku运行node.js应用程序。
From my git repository folder, I'm doing: heroku run node main.js
. 从我的git仓库文件夹中,我正在做: heroku run node main.js
It all works fine, the app starts running. 一切正常,该应用程序开始运行。 But when I close the command prompt window, the app stops working. 但是,当我关闭命令提示符窗口时,该应用程序停止运行。 Shouldn't it keep running in Heroku's servers? 它不应该继续在Heroku的服务器上运行吗?
Using the heroku run
command launches a One-Off Dyno , which is basically a dyno attached to your terminal and therefore it closes when you close the terminal. 使用heroku run
命令会启动一次一次Dyno ,它基本上是连接到终端的dyno,因此在关闭终端时会关闭。
In your case, you may want to check the Heroku's guide on Deploying Node.js Apps 就您而言,您可能需要查看Heroku关于部署Node.js应用程序的指南
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.