Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

housekeeping: consolidate env vars and extract values that don't change out to be in the source code. #31

Open
vanderhoop opened this issue Apr 12, 2023 · 0 comments

Comments

@vanderhoop
Copy link
Collaborator

vanderhoop commented Apr 12, 2023

At the moment, we have many env vars that are redundant or not consistently named. Consider the following set of env vars for prod, as they appear in our application.template.yml file (below), where API_URL and BASE_PATH both point to the same value, as do NODE_ENV and ENV. Additionally, I had to add a REACT_APP_API_URL in #30.

I suspect this is owed to the merge of the BE and FE needing similar configs, and having different naming conventions. I propose consolidating where possible, and removing env vars if they have the same value across values (which is true of BASE_PATH and SWAGGER_ENDPOINT.

production:
  NODE_ENV: production
  ENV: production
  PROXY_ENFORCE: false
  PROXIED_API_URL: ''
  PROXIED_API_TOKEN: ''

  # === FE ===
  API_URL: /api/v1

  # === BE ===
  # PORT
  PORT: 8080

  # LOG
  LOG_FORMAT: prod
  LOG_DIR: ../../../tmp

  # CORS
  ORIGIN: "*" # we'll want to limit CORS in prod once we have a domain
  CREDENTIALS: true

  # SWAGGER_SERVER_URL: http://localhost:3000
  SWAGGER_ENDPOINT: /api-docs

  # API
  BASE_PATH: /api/v1
  SERVER_STATIC_BUILD: 'true'

  # DATABASE
  DATABASE_URL: your-production-postgres-url
  SHADOW_DATABASE_URL: your-production-shadow-postgres-url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant