Skip to content

Instantly share code, notes, and snippets.

@kluto
kluto / node_nginx_ssl.md
Created December 11, 2020 15:30 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

https://stackoverflow.com/a/33289679
To compare a local working directory against a remote branch, for example origin/master:
git fetch origin master
This tells git to fetch the branch named 'master' from the remote named 'origin'. Git fetch will not affect the files in your working directory; it does not try to merge changes like git pull does.
git diff --summary FETCH_HEAD
When the remote branch is fetched, it can be referenced locally via FETCH_HEAD. The command above tells git to diff the working directory files against FETCHed branch's HEAD and report the results in summary format. Summary format gives an overview of the changes, usually a good way to start. If you want a bit more info, use --stat instead of --summary.
git diff FETCH_HEAD -- mydir/myfile.js
If you want to see changes to a specific file, for example myfile.js, skip the --summary option and reference the file you want (or tree).