raftheunis87 / tradingview-to-telegram-webhook-bot

A webhook written in Typescript to send TradingView alerts to a Telegram Bot.
47 stars 21 forks source link

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

Open borislee0227 opened 3 years ago

borislee0227 commented 3 years ago

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.

raftheunis87 commented 3 years ago

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

Estb commented 2 years ago

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