This sheet goes along with this SSH YouTube tutorial
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
Running a script in the background in linux can be done using nohup
, using nohup we can run node application in the background
$ nohup node server.js > /dev/null 2>&1 &
nohup
means: Do not terminate this process even when the stty is cut off> /dev/null
means: stdout goes to /dev/null
(which is a dummy device that does not record any output)$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
const http = require('http'); | |
const PORT = Number(process.argv[2]) || 8080; | |
const child_process = require('child_process'); | |
const Routes = { | |
BATTERY: /\/battery\/?/ | |
}; | |
const Status = { | |
NOT_FOUND: 404, |