After installing Firebase and initializing the data in the Firebase Realtime Database, append the following code to your public/script.js file:
/** * Initialize a new database with the firebase.database
constructor */ const database = firebase.database() /** * database.ref returns a reference to a key in the
realtime database. * This reference comes with a listener to read the value
for the first time, and execute some action everytime a
value is received */ const temperatureListener = database.ref('temperature') temperatureListener.on('value', data => { /** * The contents of the listener are pretty much the
same as the listeners in our previous chapters. The only difference being that the value * of the data being read has...