tradingview-to-telegram-webhook-bot icon indicating copy to clipboard operation
tradingview-to-telegram-webhook-bot copied to clipboard

How can I make this project executable after I offline my vps?

Open borislee0227 opened this issue 3 years ago • 2 comments

This is a very helpful project for me, but I'm sorry, I am a novice in node.js, I have successfully set the environment variable permanently on my vps from google. But I can't find a way to make this project executable after I offline my vps. For example, when using PM2, I am not sure which file PM2 needs to be set on.

So what do I need to set up so that this project can be executed after I offline my vps? Whether you help me or not, I will be very grateful for your project.

borislee0227 avatar Apr 12 '21 16:04 borislee0227

Hey man, glad to hear that this is helping you out.

I assume you use ssh to connect to your VPS. You then need to go to the root folder of the project.

Then you can do the following:

  1. npm run build
  2. cd dist
  3. pm2 start main.js
  4. pm2 startup
  5. pm2 save

I have written this down without actually performing the commands myself. If you have any issues, please let me know.

Kind regards,

Raf

raftheunis87 avatar Apr 13 '21 04:04 raftheunis87

Hey man, glad to hear that this is helping you out.

I assume you use ssh to connect to your VPS. You then need to go to the root folder of the project.

Then you can do the following:

  1. npm run build
  2. cd dist
  3. pm2 start main.js
  4. pm2 startup
  5. pm2 save

I have written this down without actually performing the commands myself. If you have any issues, please let me know.

Kind regards,

Raf

hello

To run pm2 correctly it is necessary to give pm2 start in the previous folder, if running within the dist it gives errors of missing environment variable.

the correct one would be

pm2 start dist/main.js --name main.js

Estb avatar Aug 24 '22 21:08 Estb