4

i'm devolping a web application in wich i need to storage images. I wish i could use database storage but i've some problems. I've already read the docs but the storage part has no docs for node or server but only for web. 1) i've already inizialite my app through my json file and i can access the database,how can i access the storage from my nodejs code? it return me firebase.storage is not a function.

2) i don't understand how can i storage an image , i post my code :

var firebase = require("firebase");
var express = require('express');
var app= express();

firebase.initializeApp({
  serviceAccount: "my-json-file",
  databaseURL: "my-database file"
   });

var storage = firebase.storage();
var storageRef = storage.ref();


app.get('/add',function(req,res){
   var first = storageRef.child('/home/nicco/Scrivania/0first.eps');
   var uploadTask = storageRef.child('images/' + file.name).put(file);
 })

app.get('/', function (req, res) {
 res.send('Hello World!');

  }); 

 app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
  });
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 3
    There is no node.js client for Firebase Storage. But since Firebase Storage is a client-side wrapper around Google Cloud Storage, you can just use the `gcloud` client from your node.js script. See http://stackoverflow.com/questions/37868485/secure-external-links-for-firebase-storage-on-nodejs-server-side – Frank van Puffelen Jul 13 '16 at 14:45

0 Answers0