Reputation: 73
I am a beginner trying to learn web development. I have built small node js app and deployed in heroku. I am trying to do the same in GCP and learn the platform.
Code used is @ https://github.com/unnikrishnan-r/firstgcpdeployment
The issue that I am facing is Unable to access env variables in the app
My index.js
exports.envVar = (req, res) => {
// Sends 'bar' as response
console.log("bbbccc");
console.log(process.env.JAWSDB_URL);
res.status(200).send(process.env.JAWSDB_URL);
return process.env.JAWSDB_URL;
};
.env.yaml is
JAWSDB_URL: testtest456
I then used below to deploy the function to gcloud
gcloud functions deploy envVar --env-vars-file .env.yaml --runtime nodejs8 --trigger-http;
Deployment was successful and was tested using console and https://us-central1-howtodeployingcp.cloudfunctions.net/envVar
During deploy this happened
Can some one help me here?
Upvotes: 1
Views: 874