sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginxsudo mkdir -p /var/www/hm25
sudo chown -R www-data:www-data /var/www/hm25
sudo chmod -R 755 /var/www/hm25sudo apt install git
sudo apt install curlFor latest version, please refer to https://github.com/nvm-sh/nvm/releases
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bashthen
source ~/.bashrc
nvm install --lts
curl -fsSL https://get.pnpm.io/install.sh | sh -
source ~/.bashrcverify installation
pnpm -vgit clone https://github.com/icyblob/hm25-frontendpnpm installREACT_APP_HTTP_ENDPOINT=http://<server_ip> pnpm buildAdd your <server_ip> in the command to set the REACT_APP_HTTP_ENDPOINT in this file
If no errors, it's ready for the deployment
Use either scp or rsync
# At the HM25 repo's root directory
scp -r build/* user@your_server_ip:/var/www/hm25rsync -avzHit build/* user@your_server_ip:/var/www/hm25sudo vim /etc/nginx/sites-available/hm25Copy the below
server {
listen 8081;
server_name <your_server_ip>;
root /var/www/hm25;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
Create symlink
# Remove sites default
rm /etc/nginx/sites-available/default
rm /etc/nginx/sites-enabled/default
# Enable the current config
sudo ln -s /etc/nginx/sites-available/hm25 /etc/nginx/sites-enabled/sudo nginx -t
# If it shows
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful
# then go ahead with this command
sudo systemctl reload nginxOpen the app through http://<your_server_ip>:8081
If you have already launched the node with <node_ip>, try to connect it with our frontend. Open the Lock/Unlock icon at the top right of the app, select Connect to Server, then add your node url:
http://<node_ip>
Then refresh the page