The first part of moving to firebase is migrating our client-side files, which includes all of the HTML, CSS, and client-side JavaScript files we were serving earlier.
Our files are not going to be served on our application server anymore, and we will not be using its APIs anymore. In order to clean things up, we are going to remove the contents of all our API-invoking functions that were there in the client-side script, such as fetchTemperature, fetchHumidity, fetchHumidityHistory, fetchTemperatureHistory, fetchHumidityRange, and fetchTemperatureRange.
The resultant script.js file will look like this:
const temperatureCanvasCtx = document .getElementById('temperature-chart') .getContext('2d') const temperatureChartConfig = { type: 'line', data: { labels: [], datasets...