From 7eed888dd73737a4e8cdfbe6d64cd126320fff06 Mon Sep 17 00:00:00 2001 From: Simon Young <40179067+Kastier1@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:51:01 -0800 Subject: [PATCH] add env var for hostname (#1150) * add env var for hostname * 3.11 compatiable --------- Co-authored-by: simon --- pcweb/pages/docs/custom_components.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcweb/pages/docs/custom_components.py b/pcweb/pages/docs/custom_components.py index feb25114d5..f688e9a6bc 100644 --- a/pcweb/pages/docs/custom_components.py +++ b/pcweb/pages/docs/custom_components.py @@ -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 @@ -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: