Is it possible to upload files using cloud functions? This is my attempt:
const firebase = require("firebase");
app.post('/images', async function (request, response) {
const data = request.body;
var file = data.image; // base64 image data
const storageRef = firebase.storage().ref(`images/${data.name}`);
storageRef.putString(file, 'data_url').then(function (snapshot) {
response.send('success')
});
})
and I'm getting error UnhandledPromiseRejectionWarning: TypeError: firebase.storage is not a function is there any example that I can find?