简体   繁体   中英

How to run nodejs app as service with forever or upstart?

I am running my app as below

NODE_ENV=production node_modules/.bin/babel-node --presets 'react,es2015' src/server.js

How to run it as service with forever or upstart?

I suggest you to use PM2 as a process manager.

by the way, with forever you should create a forever.[environment].json that forever uses as a configuration file:

 [ { // App2 "uid": "app2", "append": true, "watch": true, "script": "index.js", "sourceDir": "/home/myuser/app2", "args": ["--port", "8081"] // CLI ARGS HERE } ] 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM