Node 10.x is the latest version of node that works on the arm6 of the Pi Zero
Get the latest distrobution here https://nodejs.org/dist/latest-v10.x/ and run commands like below:
$ wget https://nodejs.org/dist/latest-v10.x/node-v10.23.0-linux-armv6l.tar.xz
$ tar xvf node-v10.23.0-linux-armv6l.tar.xz
$ sudo cp -r node-v10.23.0-linux-armv6l/* /usr/local/
$ node -v
$ npm -v
$ git clone git@github.com:wurmr/pool-monitor.git
$ cd pool-monitor/monitor
$ npm ci
$ npm run build
General documanation can be found here.
Create a service script /etc/systemd/system/pool-monitor.service
[Unit]
Description=Pool Monitor
After=network.target
[Service]
ExecStart=/usr/bin/npm start
WorkingDirectory=/home/pi/pool-monitor/monitor
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
Start and Enable the service
$ sudo systemctl start pool-monitor
$ sudo systemctl enable pool-monitor
Reference documation here
$ sudo apt update
$ sudo apt install nginx
$ sudo /etc/init.d/nginx start
$ cd pool-monitor/web
$ npm ci
$ npm run build
$ sudo cp -r build/* /var/www/html
$ sudo nano /etc/nginx/sites-enabled/default
Add a new location
section to the file directly below the default /
location
location /api {
proxy_pass http://localhost:4000;
}
Restart nginx
$ sudo /etc/init.d/nginx restart
Open a web browser to your pool pi port 80 and see if it works.