Adapted from resources:
Serve from localhost within project directory
use VS Code Live Preview extension.
Use NodeJS web server with self signed cert. NOTE: sensor API feature is only availabel in secture contexts with https.
Setup: create self signed ssl cert
npm install -g mkcert
mkdir -p ~/cert
cd ~/cert
mkcert create-ca
mkcert create-cert
Locally host server.
npx http-server -S -C ~/cert/cert.crt -K ~/cert/cert.key