【发布时间】:2014-11-06 15:50:34
【问题描述】:
我曾经使用以下方式启动我的应用程序:
DEBUG=chakka ENVIRONMENT=production npm start
我怎样才能永远使用它,这样我就不必每次想要测试应用程序时都这样做?谢谢!
【问题讨论】:
我曾经使用以下方式启动我的应用程序:
DEBUG=chakka ENVIRONMENT=production npm start
我怎样才能永远使用它,这样我就不必每次想要测试应用程序时都这样做?谢谢!
【问题讨论】:
首先您需要知道应用程序的主脚本文件是什么。打开你的 package.json 文件并找出 start 脚本是什么。如果您使用 Express,它可能是 app.js。因此,我们将在此示例中假设 app.js,替换为您的文件。
启动应用程序:
DEBUG=chakka ENVIRONMENT=production forever start app.js
在您进行更改后重新启动应用程序:
forever restart app.js
【讨论】:
ENVIRONMENT=production forever start app.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: app.js