1. Install node.js from --> https://deb.nodesource.com/
2. check node version --> node -v
3. check node package manager version --> npm -v
4. Install mongodb from --> https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/
5. sudo systemctl start mongod
6. sudo systemctl enable mongod
7. mongosh
8. test> show dbs
9. test> exit
10. npm list
11. Clone your project from Github --> git clone https://github.com/thirunahari/short-url-nodejs.git
12. go to short-url-nodejs directory
13. cd short-url-nodejs
14. npm install
15. sudo npm i pm2 -g\
npm list -g
pm2 list
16. pm2 start index
17. pm2 startup
18. sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u ubuntu --hp /home/ubuntu
copy and execute the output and make auto start of an node.js app even on reboot
mongosh
test> show dbs
test> use short-url
short-url> show collections
exit
sudo apt install nginx -y
sudo systemctl enable nginx
sudo vi /etc/nginx/sites-available/default
server_name yourdomain.com www.yourdomain.com;
location / {
proxy_pass http://localhost:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
Check NGINX config
sudo nginx -t
Restart NGINX
sudo nginx -s reload
Add SSL with LetsEncrypt
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Only valid for 90 days, test the renewal process with
certbot renew --dry-run
short-url-nodejs's Introduction
short-url-nodejs's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.