简体   繁体   中英

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! :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM