Running a node app in ubuntu

asheinfeld

I have a node application that I basically run in 4 steps since I also need to run MongoDB and Redis:

mongod --config=/etc/mongod.conf
service redis start
npm run local
npm run work-local

Right now I basically open 2 tabs, run Redis server (which runs in the bg) then I execute the mongod line which basically hangs there so I open another tab and execute a shell script containing both npm commands.

How can I make a script to make them all run with one command? If I disconnect from the ssh session it stops, but I want it to run forever.

asheinfeld

I ended up using pm2 to run all my node apps in one command while keeping them alive constantly. It was more than I was looking for, and I'm super happy with it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Running an app with multicores on ubuntu

expressJS/Node app running error

App Engine Node flexible instance constantly running

Running an angular app using node js

Running app Node.js on webhosting - not local -

Start node app through ssh, stays running?

Running fastapi app using uvicorn on ubuntu server

Error while running react native app in ubuntu

Angular app is not running on (Ubuntu) digitalocean server?

Published .Net 7 app not running on ubuntu

Docker service laravel app not running when not running in manager node

Running node-webkit as node.js app

How to get Node.js app running on Azure App Service?

How to run node webkit app in ubuntu 12.04?(Node js)

Node Server Running on Ubuntu that needs to execute a C# application - how?

pointing node.js app to my ip address and running locally

Heroku: How to deploy a node app with client and server running on different ports?

Running Angular app as docker image using Node js

"Error: spawn mongoexport ENOENT" when running dockerized node app

Running Angular2 app with Node Js server

express-session - is it possible to change the secret while the node app is running?

Why is Firebase not running my functions folder (for a node app)?

Running GraphicsMagick in AWS Lambda Node app produces no output

Is there a programmatic way to know a node.js app is running in Heroku?

Node JS app running at the same time as express api with MongoDB

Cannot find module for a node js app running in a docker compose environment

Running node only works correctly from app directory

How to use IPFS from Javascript app without running ipfs node?

Running Node.js app and PHP in same machine