vendredi 28 février 2020

Firebase Storage Downloading Image CORS error [JavaScript]

When I run the code below, I got CORS error and any help would be greatly appreciated. Thanks I tried a few answers in this topic here in StackOverflow but nothing helped me.

// Your web app's Firebase configuration
      var firebaseConfig = {
        apiKey: "**********",
        authDomain: "********",
        databaseURL: "********",
        projectId: "********",
        storageBucket: "********",
        messagingSenderId: "********",
        appId: "********",
        measurementId: "********"
      };

      // Initialize Firebase
      firebase.initializeApp(firebaseConfig);

      var storage = firebase.storage();
      var storageRef = storage.ref('image');
      var starRef = storageRef.child('image1.jpg');

      starRef.getDownloadURL().then(url => {
        console.log(url);
      })

enter image description here




Aucun commentaire:

Enregistrer un commentaire