Home > OS >  How to run node js for my webpage without using a console to start?
How to run node js for my webpage without using a console to start?

Time:10-15

The company I currently work now has a FTP server where they add all things needed for serverside, the website I made is currently working fine, I just threw it all in the FTP folder, but I needed to add some backend stuff (register, login, etc) and I used NodeJs to make it. The thing is, I need to use a console to get to the FTP through SSH to start the server.js file, but I can't use a terminal to get to there.

Is there a way I can use the "node server.js" without using a console in FTP?

CodePudding user response:

Use a tool like pm2 to constantly monitor the folder. It'll restart if it detects any code changes.

https://pm2.keymetrics.io/

CodePudding user response:

Why can't you use a console? If you are worried about it running as a background task after you close the ssh session, then you may want to look into the screen command

  • Related