I am currently working on Node.js and firebase and I am currently stuck in an issue, where after writing the data in database my program does not end on a terminal, is there a way I can end this.
I guess, maybe I need to end the firebase connection but I don't have an idea how would I do that.
Here is the program,
module.exports=
{
create_firebase_entry: function ()
{
console.log("Firebase Entry")
return new Promise((resolve, reject) => {
var secondaryAppConfig =
{
credential: admin.credential.cert(serviceAccount),
databaseURL: "firebase_databse_url"
};
if (admin.apps.length===0){secondary = admin.initializeApp(secondaryAppConfig, "secondary");}
// Retrieve the database.
var db = secondary.database();
var ref = db.ref("data_records");
var usersRef = ref.child("My_Data");
usersRef.set({Data1:"Trail Data"})
})
}
}