0

I have created a node.js rest api created using express framework for routing. I have used tutorial

Now I want to deploy that rest api on actual production server. How to achieve that thing.

I have gone through below links.

Deploy node js application with express framework on production mode --- Only for linux. I need for windows.

Deploying NodeJs Express Rest API to Windows 10 IoT -- a little bit similar problem but no solution

https://stackoverflow.com/a/38652869/2810015 -- this said to run npm start on production server after copying all of the files on server. But this is not working fine either.

Any help will be highly useful.

Nimish goel
  • 2,561
  • 6
  • 27
  • 42

1 Answers1

0

You use pm2?

Usually I use it to start the application. It works for both windows and linux. He leaves the service initated, and in case something happens that knocks the service up again.

You install it on the server, and instead of using it

node server.js

You use the command below

pm2 server.js start

Link: http://pm2.keymetrics.io/docs/advanced/pm2-module-system/