简体   繁体   中英

How run Express Js/MongoDB in command line and close the terminal

I wanna know how can I run an express project but hide or close the terminal.

if I close the terminal my server fall, but I wanna hide it or something I'm doing a project in a local pc and me don't wanna that the user watches or close that and the app fall.

Use a process manager like PM2 or forever .

Forever example command: forever start app.js

Try using nohup <command>

sudo nohup npm start

A long version answer is to use docker-compose with node js and run services which works in the background by running: docker-compose up -d <service_name>

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