Upload files to Firebase Storage using Node.js

前端 未结 6 671
情书的邮戳
情书的邮戳 2020-11-27 14:02

I\'m trying to understand how to upload files in Firebase Storage, using Node.js. My first try was to use the Firebase library:

"use strict";

var f         


        
6条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 14:23

    Or you could simply polyfill XmlHttpRequest like so -

    const XMLHttpRequest = require("xhr2");
    global.XMLHttpRequest = XMLHttpRequest
    

    and import

    require('firebase/storage');
    

    That's it. All firebase.storage() methods should now work.

提交回复
热议问题