NodeJS as backend for Google polymer 1.0

626 Views Asked by At

i am developing site using polymer starter kit without any knowledge in Javascript & HTML,everything is fine with the UI .I've done the UI part of the site and i have also deployed the site in firebase referring their guidelines.I used firebase for storing the form data of my site.Now i want to use nodejs for importing data from firebase and perform some calculations and update firebase fields ,because several API such as Twilio are easy to use in nodejs.if i did so ,how can i host it as single website.i don't know what should i do !

1

There are 1 best solutions below

5
On

You have here a simple code in node.js to retreive data from firebase.

After you install firebase library with npm, and set your app-token, you will be able to fetch data from firebase with this code:

    myFirebaseRef.child("location/city").on("value", function(snapshot) {
      alert(snapshot.val());  // Alerts "San Francisco"
    });