Closed HeyAshh closed 4 years ago
This happens 25 minutes into the video btw
Hi. Go to your Firebase dashboard / Settings / Service Account. At the bottom, select the Node JS Firebase Admin SDK, click on Generate Private Key. It should download a JSON for you. Rename it to something more convenient like "db.json", pase it in your /functions folder next to your index.js and insert the below into your index.js.
Database URL is in your firebase config file.
This should solve it.
const serviceAccount = require("./db.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://YOURDATABASENAME-NUMBER.firebaseio.com"
});
Been a while, but I think that solved it for me! Thanks!
Getting this error in terminal when trying to send this code in postman
Any ideas?