app.yaml / env

What is app.yaml

You configure your App Engine app's settings in the app.yaml file. The app.yaml file also contains information about your app's code, Node.js runtime, and environment variables. Each service in your app has its own app.yaml file, which acts as a descriptor for its deployment. You must first create the app.yaml file for the default service before you can create and deploy app.yaml files for additional services within your app.

https://cloud.google.com/appengine/docs/standard/nodejs/config/appref

app.yaml

runtime: nodejs16
instance_class: F2
max_instances: 5 // Specify a value between 0 and 2147483647, where zero disables the setting
min_instances: 1 // Specify a value between 0 and 2147483647, where zero disables the setting

network: // use this to get websocket from your provider
  session_affinity: true

env_variables:
  API1: "xxx" // dont forget to use tab on each childs
  API2: "yyy"
  API3: "zzz"
  API4: "aaa"nv
  API5: "bbb"

handlers:
- url: /stylesheets
  static_dir: stylesheets

- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto
  • runtime = use node -v in your terminal to get your node version

  • network :session_affinity = use this to run web socket

  • env_variables: move .env to app.yaml to run in app engin

.gitignore

node_modules
/node_modules
.env
cloud_sql_proxy.exe
app.yaml

Standard environment instance specification

https://cloud.google.com/appengine/docs/standard

Pricing instance

Last updated

Was this helpful?