Merge pull request #3 from santanafabio/patch-2
Reference to "storageBucket" on init
This commit is contained in:
@ -23,14 +23,9 @@ output: <whatever data was at the path 'foo/bar' in the rtdb database>
|
|||||||
## rtdb-set
|
## rtdb-set
|
||||||
Set data at a path in the rtdb database. Use 'on' snapshot so will fire every time the data at the path changes and so drive flow execution from that point.
|
Set data at a path in the rtdb database. Use 'on' snapshot so will fire every time the data at the path changes and so drive flow execution from that point.
|
||||||
|
|
||||||
input: {payload: {path: 'foo/bar', obj: {some: 'object', foo: 17}}
|
|
||||||
|
|
||||||
## rtdb-push
|
## rtdb-push
|
||||||
Pushes the new object onto an array under the path
|
Pushes the new object onto an array under the path
|
||||||
|
|
||||||
input: {payload: {path: 'foo/bar'}, {some: 'object', foo: 17}}
|
|
||||||
output: the url to the newly pushed data () something like "https://xxxx-1111.firebaseio.com/foo/quux/-LhzUELu7Vv4DCD16zTK")
|
|
||||||
|
|
||||||
## rtdb-query
|
## rtdb-query
|
||||||
Set up a reactive query for a path in the rtdb database.
|
Set up a reactive query for a path in the rtdb database.
|
||||||
|
|
||||||
|
|||||||
@ -6,18 +6,21 @@ module.exports = function(RED) {
|
|||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
this.cred = n.cred
|
this.cred = n.cred
|
||||||
this.dburl = n.dburl
|
this.dburl = n.dburl
|
||||||
|
this.sturl = n.sturl
|
||||||
this.admin = _admin
|
this.admin = _admin
|
||||||
if(!init){
|
if(!init){
|
||||||
console.log('setting admin....')
|
console.log('setting admin....')
|
||||||
init = true
|
init = true
|
||||||
this.credentials = JSON.parse(this.cred);
|
this.credentials = JSON.parse(this.cred);
|
||||||
this.dburl = this.dburl
|
this.dburl = this.dburl
|
||||||
|
this.sturl = this.sturl
|
||||||
console.log('*** parsed firebase credentials: '+this.credentials.type+', project-id: '+this.credentials.project_id)
|
console.log('*** parsed firebase credentials: '+this.credentials.type+', project-id: '+this.credentials.project_id)
|
||||||
_admin.initializeApp({
|
_admin.initializeApp({
|
||||||
credential: _admin.credential.cert(this.credentials),
|
credential: _admin.credential.cert(this.credentials),
|
||||||
databaseURL: this.dburl
|
databaseURL: this.dburl,
|
||||||
|
storageBucket: this.sturl
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("firebase-config", FirebaseConfigNode);
|
RED.nodes.registerType("firebase-config", FirebaseConfigNode);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user