Saturday 15 April 2017

node firebase application not working on CENTOS

i'm new in the linux world. I have successfully installed a new version of CentOS 7 on my HP MicroServer Gen8. Also installed node and successfully tested some small local applications. I want to use firebase to make some server side applications, but I dont manage to connect to firebase. Here is my code:

var admin = require("firebase-admin");
var serviceAccount = require("./centostest-7501a-firebase-adminsdk-dixyp-bc27f7bc9f.json");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://centostest-7501a.firebaseio.com"
});

var db = admin.database();
var ref = db.ref();
ref.on("value", function(snapshot) {
  console.log(snapshot.val());
});

I have saved some data in firebase database for testing purposes, but it seems that I cant reach to it. I have successfully tested the code on other windows PC and it works. I think its a configuration problem in CentOS (firewall, ports ...) but I can't figure it out.



via user3755669

No comments:

Post a Comment