From cb7082607ed77b1e215140186e96a189d21cdc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20G=C3=B6k=C3=A7e?= Date: Fri, 1 Mar 2019 09:11:20 +0300 Subject: [PATCH] Update server.js --- Raspberry Pi/server.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Raspberry Pi/server.js b/Raspberry Pi/server.js index 51e7a42..73ed19d 100644 --- a/Raspberry Pi/server.js +++ b/Raspberry Pi/server.js @@ -1,6 +1,7 @@ -/* Firebase Admin SDK Configuration */ var admin = require("firebase-admin"); -var fs = require('fs'); + +// filestream library for writing file +var fs = require('fs'); const ACTIVATE = "activate"; const DEACTIVATE = "deactivate"; @@ -22,14 +23,8 @@ admin.initializeApp({ var defaultDatabase = admin.database(); var ref = defaultDatabase.ref(); -// You can retrieve services via the defaultApp variable... -var defaultDatabase = admin.database(); -var ref = defaultDatabase.ref(); - entitiesFromAssistant = {} -var ref = defaultDatabase.ref(); - ref.on('value', function (snapshot) { snapshot.forEach(function (childSnapshot) {