Skip to content

feat: set frontend and backend url from env var#58

Merged
jeffydc merged 2 commits intomainfrom
feat/url-env
Jun 15, 2021
Merged

feat: set frontend and backend url from env var#58
jeffydc merged 2 commits intomainfrom
feat/url-env

Conversation

@jeffydc
Copy link
Copy Markdown
Contributor

@jeffydc jeffydc commented Jun 15, 2021

Description

Set frontend and backend url from environment variable
This could allow the forks of this repo to have their own playground + playground URLs.

Additional context

Usage:

Set PG_BACKEND_SITE_NAME and PG_BACKEND_SITE_NAME_PR in Netlify UI for backend site name, not url.
Those environment variables are used to make backend API URL.

Set PG_FRONTEND_SITE_NAME (this is site name) and CUSTOM_DOMAIN_URL (optional, this is url) in heroku for frontend.
There is no env var for pull request since netlify generates a deploy preview url by default. So, only the site name is needed.

There is also an optional CUSTOM_DOMAIN_URL env var which can be used to set custom domain url. When setting this environment variable, if you are not sure the correct url form, you can use location.origin to get the correct url name for connecting frontend and backend.


What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

@jeffydc jeffydc added the enhancement New feature or request label Jun 15, 2021
@netlify
Copy link
Copy Markdown

netlify bot commented Jun 15, 2021

✔️ Deploy Preview for python-playground ready!

🔨 Explore the source changes: 18f63a4

🔍 Inspect the deploy log: https://app.netlify.com/sites/python-playground/deploys/60c8c0590431170007eb4694

😎 Browse the preview: https://deploy-preview-58--python-playground.netlify.app/

@jeffydc jeffydc temporarily deployed to pp-api-pr-58 June 15, 2021 14:47 Inactive
@jeffydc jeffydc temporarily deployed to pp-api-pr-58 June 15, 2021 14:59 Inactive
@jeffydc jeffydc merged commit 05fb3ba into main Jun 15, 2021
@jeffydc jeffydc deleted the feat/url-env branch June 15, 2021 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant