question

sandy.davis_63587 avatar image
sandy.davis_63587 asked Erick Ramirez answered

Where do I find the BASE_ADDRESS URL for the .env file in week 4 Python exercise?

Where do I find the values for your_id and your_region to complete this URL?

BASE_ADDRESS=https://<your_port>-<your_id>.<your_region>.gitpod.io/api


workshop
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bettina.swynnerton avatar image
bettina.swynnerton answered

Hi @sandy.davis_63587,

after you launch the Python API on gitpod, you are invited to make port 5000 public and open a browser.

When you open a browser, copy the URL: This is the base address that you reach through port 5000.

You will see that it has this format:

https://5000-<your_unique_UUID>.<your_region>.gitpod.io

To pass this base address to the UI, you need to append the /api route, as in the instructions.

Let us know if this gets you to the next step.

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

To add to Bettina's answer, here's what my Gitpod looks like after I ran the "getting started" script in this section of the workshop instructions:

When I click on the Open Browser button at the bottom of the page, a new tab opens in my browser with the generated URL:

So using my URL as an example:

  • my app port is 5000 (the default because I didn't reconfigure it in the script)
  • my Gitpod ID (UUID) is d83df32b-81af-425d-8ede-b1f3d19b9480
  • my Gitpod region is ws-us02

Then as you already know, you need to add the URI /api at the end so in this step of the instructions, my BASE_ADDRESS is:

https://5000-d83df32b-81af-425d-8ede-b1f3d19b9480.ws-us02.gitpod.io/api

In a Gitpod terminal:

$ cd week4-AppDev-api/getting-started-with-astra-ui
$ echo 'BASE_ADDRESS=https://5000-d83df32b-81af-425d-8ede-b1f3d19b9480.ws-us02.gitpod.io/api' > .env

Hope this helps. Cheers!


Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.