A simple backend server to report speedtest to firebase.
I use this backend in my Raspberry Pi to report the speedtest periodically for to Firebase for tracking purpose.
- Build the project
npm run dist
- Deploy to server
- Install packages
yarn install --production=true
- Change the
config.js
to your firebase accountexports.default = { // ... firebase: { databaseUrl: 'your database URL is here', serviceAccount: {} // your service account is here }, speedtest: { maxTime: 5000 // time limit to run each speedtest } };
- Set up the script to run every 15 minutes in your crontab
crontab -e */15 * * * * /usr/bin/node /home/pi/prod/speedtest/index.js >> /home/pi/prod/speedtest/run.log