Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nest Js (Node Js Framework) - How to start server on Digital Ocean using pm2?

I have developed my project in the Nest JS framework. My main file in the src folder (src/main.ts). How can I start the server on my Digital Ocean server?

like image 338
Alessia Williams Avatar asked Jan 25 '23 21:01

Alessia Williams


1 Answers

After you build the project, then it will have main.js file under /dist. So just run:

pm2 start PATH_TO_YOUR_PROJECT/dist/main.js --name=YOUR_APP_NAME
like image 50
topmoon Avatar answered Jan 27 '23 11:01

topmoon