mardi 31 juillet 2018

Configure Multiple projects for one web application

I created two different projects in firebase Project-A and Project-B. I am developing a web application using html, css and javascript and deployed(Hosted) to project-A. I want to get the data from Project-B into my web application. I have configured two projects in my web application like below

  var config = {
     apiKey: "<API_KEY>",
     authDomain: "<PROJECT_ID>.firebaseapp.com",
     databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
     storageBucket: "<BUCKET>.appspot.com",
  };

  var secondaryAppConfig = {
      apiKey: "<API_KEY>",
      authDomain: "<PROJECT_ID>.firebaseapp.com",
      databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
      storageBucket: "<BUCKET>.appspot.com",
    };

  var secondary = firebase.initializeApp(secondaryAppConfig, "secondary");

  var secondaryDatabase = secondary.database();

  (this declared in .js file and this file called in index.html)

Now i want to get data from firestore from secondaryAppConfig project.

Thanks in Advance.




Aucun commentaire:

Enregistrer un commentaire