Reader small image

You're reading from  Full Stack Web Development with Raspberry Pi 3

Product typeBook
Published inAug 2017
Reading LevelExpert
PublisherPackt
ISBN-139781788295895
Edition1st Edition
Languages
Right arrow
Author (1)
Soham Kamani
Soham Kamani
author image
Soham Kamani

Soham Kamani is a full-stack developer who has extensive experience in the JavaScript ecosystem. He works as a consultant, developing end-to-end web-based solutions for clients around the world. He is an open source enthusiast and an avid blogger. He has worked on many frameworks and technologies such as React, Angular, Node, Express, Sails, SQLite, Postgres, and MySQL, and he has worked on many projects in the IoT space using Arduino and Raspberry Pi systems.
Read more about Soham Kamani

Right arrow

Migrating the frontend assets

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...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Full Stack Web Development with Raspberry Pi 3
Published in: Aug 2017Publisher: PacktISBN-13: 9781788295895

Author (1)

author image
Soham Kamani

Soham Kamani is a full-stack developer who has extensive experience in the JavaScript ecosystem. He works as a consultant, developing end-to-end web-based solutions for clients around the world. He is an open source enthusiast and an avid blogger. He has worked on many frameworks and technologies such as React, Angular, Node, Express, Sails, SQLite, Postgres, and MySQL, and he has worked on many projects in the IoT space using Arduino and Raspberry Pi systems.
Read more about Soham Kamani