Last active
July 18, 2019 08:27
-
-
Save haseebpvt/ab97419d4241750be2a2342b30f75eab to your computer and use it in GitHub Desktop.
Writing to firebase with Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Install firebase admin | |
| //npm install firebase-admin --save | |
| //Get generated key and place it in the working directory | |
| //Replace line 7 file name with yours | |
| var firebase = require("firebase-admin"); | |
| var serviceAccount = require("./service_accountKey.json"); | |
| firebase.initializeApp({ | |
| credential: firebase.credential.cert(serviceAccount), | |
| databaseURL: "your_database_link_here" | |
| }); | |
| firebase.database().ref("sensor").child("sen_1").child("temp").set("Hello"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment