Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run React Boilerplate with forever

I'm going to run react-boilerplate application forever in the server. I found forever and I'm not sure how I pass parameters to forever. The command to run server is like following:

PORT=80 npm run start:production

Seems like forever start PORT=80 npm run start:production doesn't help me.

like image 837
Smart Solutions Avatar asked Mar 05 '18 04:03

Smart Solutions


1 Answers

One thing is that PORT=80 part is setting the env variable, this kind of command should be in front of other commands. The other thing is that to run npm scripts with forever, you need to use different syntax, so PORT=80 forever start -c "npm run start:production" /path/to/app/dir/.

If you're running forever form the project folder, the path should be ./

like image 144
Gleb Kostyunin Avatar answered Sep 28 '22 10:09

Gleb Kostyunin