I tried to sucessfully bulid node js api using crud Operation and working fine in locally.but how to move production to live see the api data.I tried pm2 but also working for local ipaddress.how to solve this problem any solution..
Asked
Active
Viewed 62 times
-1
-
Please post your code so we can understand what you are trying to do. – Oo-_-oO Apr 22 '19 at 06:55
2 Answers
0
Change the host name in server.js or index.js file from 'localhost' to 0.0.0.0 then you server will expose to the outside of the your network
- Change 'localhost' to '0.0.0.0'
- If you have any firewalls you must allow your server port to outside network.

Sai Kumar
- 287
- 1
- 5
-1
If you are using pm2, you can select environment as production while starting the process.
pm2 start config.js --env production

KpBhat
- 29
- 7