- Installing Git
sudo apt install git
- Cloning the repository
git clone https://github.com/nima-ra/TeamTwist.git
- CD to the directory
cd TeamTwist
- Installing dependencies
npm install
- Installing pm2
npm install -g pm2
- Marking main.js executable:
chmod +x ./main.js
- Getting into editor mode for editing nginx defaults
nano /etc/nginx/sites-available/default
- Adding this code to the server block
location / {
proxy_pass http://localhost:8545;
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;
}
- Restarting Nginx
sudo systemctl restart nginx
- Launching code
pm2 start main.js