Created
March 11, 2019 02:06
-
-
Save andresmijares/dedcbff0022b4df5469af073020e4272 to your computer and use it in GitHub Desktop.
This file contains 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
'use strict' | |
const admin = require('firebase-admin') | |
const serviceAccount = require('your_firebase_key') | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount) | |
}) | |
const firestore = admin.firestore() | |
const settings = { timestampsInSnapshots: true } | |
module.exports.hello = async (event) => { | |
const data = firebase.collection('my_nice_collection') | |
.get() | |
.then(s => { | |
// do whatever you need with your data | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment