react-starter-kit icon indicating copy to clipboard operation
react-starter-kit copied to clipboard

is it possible to run with forever

Open hoony-o-1 opened this issue 11 years ago • 7 comments

I'd like to run an app with this template on linux server.

can I run with forever or something like forever?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

hoony-o-1 avatar Jun 27 '15 06:06 hoony-o-1

@thechunsik cource you can; just package it and than run

forever start build/server.js

cmnstmntmn avatar Jun 27 '15 10:06 cmnstmntmn

I am running it (forever) in way mentioned by @cmnstmntmn and it works like a charm!

korczis avatar Jul 09 '15 13:07 korczis

PM2 is an alternative to forever.

ghost avatar Jul 09 '15 21:07 ghost

How can i run server with PM2? i can try _pm2 start build/server.js _ and pm2 start tools/run.js But it's not correct way. How to?

dastiw1 avatar Feb 25 '16 06:02 dastiw1

For pm2 you will need to create an application declaration at the root of react-starter-kit like this:

{
  "apps": [
    {
      "name": "react-starter-kit",
      "script": "tools/run.js",
      "args": ["start", "--release"],
      "exec_interpreter": "./node_modules/.bin/babel-node",
      "exec_mode": "fork",
    }
  ]
}

dfrankland avatar Feb 27 '16 08:02 dfrankland

@dfrankland Sorry to post this after one year, but I had to point this out for other people reaching to our answer :

babel-node must not be run in production ! See the doc for more information.

I strongly recommend to build the sources instead and run the main script using the following command : node build/server.js.

Ilshidur avatar Jan 13 '17 21:01 Ilshidur

@hoonyland thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.

NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.

ulani avatar May 27 '21 19:05 ulani