Skip to content

A simple backend server to report speedtest to firebase

License

Notifications You must be signed in to change notification settings

aduyng/speedtest-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

speedtest-backend

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 and setup for PROD

  1. Build the project
    npm run dist
  2. Deploy to server
  3. Install packages
    yarn install --production=true
  4. Change the config.js to your firebase account
    exports.default = {
      // ...
      firebase: {
        databaseUrl: 'your database URL is here',
        serviceAccount: {} // your service account is here
      },
      speedtest: {
        maxTime: 5000 // time limit to run each speedtest
      }
    };
  5. 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

Wallah, check your firebase data to see the data reported. Result in Firebase

About

A simple backend server to report speedtest to firebase

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published