简体   繁体   English

当我关闭cmd时,Heroku中的Node.js应用程序崩溃

[英]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.

相关问题 为什么当 Node.JS 应用程序与 Firebase 集成时它会崩溃? - Why when a Node.JS app is integrated with Firebase it crashes? 将Node.js应用程序部署到Heroku时出现“ ReferenceError:未定义压缩” - “ReferenceError: compression is not defined” when deploying Node.js app to Heroku 推送到Heroku时无法构建Node.js应用 - Node.js app failed to build when pushing to Heroku 在 Heroku 上部署 Node.js 应用程序时出现 403 错误 - 403 error when deploying a Node.js app on Heroku 使用Heroku部署Node.js应用程序时公共目录的问题 - Problems with public directory when deploying Node.js app with Heroku 部署 Node.js/React 应用程序时 Heroku 构建失败 - Heroku build failure when deploying Node.js/React app 当应用程序托管在 Heroku (Node.js) 上时,无法连接到 Websocket - Cant connect to Websocket when app is hosted on Heroku (Node.js) Node.js 应用程序在本地运行,但在部署到 heroku 时出现应用程序错误 - Node.js app works locally but when deploy to heroku I get application error Heroku Node.js(express.js)应用程序在本地运行,但在使用MongoDB时在heroku上失败 - Heroku Node.js (express.js) App Works Locally but failed on heroku when using MongoDB 在heroku上遇到node.js应用程序时遇到问题 - Having trouble with a node.js app on heroku
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM