Skip to content

Commit

Permalink
add env var for hostname (#1150)
Browse files Browse the repository at this point in the history
* add env var for hostname

* 3.11 compatiable

---------

Co-authored-by: simon <simon@reflex.dev>
  • Loading branch information
Kastier1 and simon authored Dec 17, 2024
1 parent cb57996 commit 7eed888
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pcweb/pages/docs/custom_components.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import reflex as rx
import httpx
import json
import os
from rxconfig import config
import reflex_chakra as rc
from pcweb.templates.docpage import docpage, h1_comp, text_comp_2
Expand All @@ -21,7 +22,9 @@ class CustomComponentGalleryState(rx.State):
@rx.event
def fetch_components_list(self):
try:
response = httpx.get(f"{config.cp_backend_url}/custom-components/gallery")
response = httpx.get(
f"{os.getenv('RCC_ENDPOINT')}/custom-components/gallery"
)
response.raise_for_status()
component_list = response.json()
except (httpx.HTTPError, json.JSONDecodeError) as ex:
Expand Down

0 comments on commit 7eed888

Please sign in to comment.