this is the request that I made using node
// Initialize the default app
var admin = require('firebase-admin');
var app = admin.initializeApp({
credential: admin.credential.applicationDefault(),
databaseURL: process.env.FIREBASE_DATABASE
});
console.log(process.env.FIREBASE_DATABASE);
router.post('/', (req, res, next) => {
app.auth().getUserByEmail("j.100233260@gmail.com")
.then(function(userRecord) {
// See the UserRecord reference doc for the contents of userRecord.
console.log('Successfully fetched user data:', userRecord.toJSON());
res.json(userRecord.toJSON())
})
.catch(function(error) {
console.log('Error fetching user data:', error);
res.json(error)
});
}
);
I set the env var on my machine
for my firebase database I used env
given as
databaseURL: "https://fssssss.firebaseio.com",
from the firebase admin GUI ,
the error in Postman when I request this route
{
"code": "app/invalid-credential",
"message": "Failed to determine project ID: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal metadata.google.internal:80. Error code: ENOTFOUND"
}
I followed the docs and google returned no results, no idea what to do. thanks.