React-starter-kit: is it possible to run with forever

Created on 27 Jun 2015  路  6Comments  路  Source: kriasoft/react-starter-kit

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.

All 6 comments

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

forever start build/server.js

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

PM2 is an alternative to forever.

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?

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 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.

Was this page helpful?
0 / 5 - 0 ratings