with PM2 & Nginx
as a root, run below commands on server:
# adduser tomy
| sudo apt-get update | |
| sudo apt-get -y upgrade | |
| sudo apt-get install python3-setuptools | |
| sudo easy_install3 pip | |
| pip -V | |
| #pip 9.0.1 from /usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg (python 3.5) | |
| sudo chown -R username:username ~/.local/ | |
| # add to ./*shrc |
| // mongoose 4.3.x | |
| var mongoose = require('mongoose'); | |
| /* | |
| * Mongoose by default sets the auto_reconnect option to true. | |
| * We recommend setting socket options at both the server and replica set level. | |
| * We recommend a 30 second connection timeout because it allows for | |
| * plenty of time in most operating environments. | |
| */ | |
| var options = { server: { socketOptions: { keepAlive: 300000, connectTimeoutMS: 30000 } }, |
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin <branch-name> |