I’m studying deploy for the first time, so please understand.
There are two issues I can’t solve.
I used json related to firebase admin sdk in the back end in the environment variable called GOOGLE_APPLICATION_CREDENTIALS
, and it worked well locally, but I haven’t been able to find GOOGLE_APPLICATION_CREDENTIALS
since I deployed it. I think it’s a natural result, but I don’t know how to solve this.
The other thing is that I get an error called failed to connect to machine: give up after 15 attempts (in 20.232591309s)
. I think it’s the result of my misconfiguration, but I don’t know what the hell is wrong.
const app = express();
const { MONGO_URI, GOOGLE_APPLICATION_CREDENTIALS } = process.env;
const PORT = process.env.PORT || 8080;
const serviceAccount = require(GOOGLE_APPLICATION_CREDENTIALS);
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
const hostname = '0.0.0.0';
app.listen(PORT, hostname);
Part of my backend app.js code.
If anyone knows, please help. Thank you.