Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
| //sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| //sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender | |
| socket.broadcast.to('game').emit('message', 'nice game'); | |
| // sending to sender client, only if they are in 'game' room(channel) |
| // sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| // sending to all clients, include sender | |
| io.emit('message', "this is a test"); | |
| // sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
Video Tutorial: https://youtu.be/Qmld1te08Ns
Update Packages
sudo apt-get updateInstall Nginx