问题
I used to start my application using:
DEBUG=chakka ENVIRONMENT=production npm start
How can i start it using forever so i wouldn't have to do it everytime i want to test the application? Thanks!
回答1:
First you need to know what the application's main script file is. Open up your package.json file and find out what the start
script is. If you're using Express it might be app.js
. So we'll assume app.js
for this example, replace with whatever your file is.
To start the application:
DEBUG=chakka ENVIRONMENT=production forever start app.js
to restart the application after you've made changes:
forever restart app.js
来源:https://stackoverflow.com/questions/26773936/forever-with-npm-start-and-environment-variable