Daniel Contreras
Daniel Contreras

Reputation: 29

Env variables on Google Cloud?

This might be a super noob question but, I deployed an app to gcloud using the console, however once deployed it did not get my .env file so, we have a sign up form on our site linked to mailchimp, however our API keys and list ID are on our .env file, how do I make Google Cloud read this file.

I'm a super newbie on this, so I read the documentation but didn't understand anything. I just know i have a nodeJS backend with a file called server.js using Express and i have a .env file with my API Keys but can't figure out how to make google read those ENV Variables.

Help?

Thank you! :)

Upvotes: 1

Views: 930

Answers (1)

rajesh-nitc
rajesh-nitc

Reputation: 5529

In the app.yaml file you can provide the env variables and consume in your app code with process.env.PORT:

runtime: nodejs10
env_variables:
  PORT: 8080

Upvotes: 1

Related Questions