From 3d851ae4f0e19388e3451b79c235db9ef07b1c6d Mon Sep 17 00:00:00 2001
From: Pinapelz <yukais@pinapelz.com>
Date: Tue, 1 Jul 2025 13:28:58 -0700
Subject: add fallbacks for optional environment variables

---
 site/src/pages/Homepage.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'site/src/pages/Homepage.tsx')

diff --git a/site/src/pages/Homepage.tsx b/site/src/pages/Homepage.tsx
index 18f2e37..0d98206 100644
--- a/site/src/pages/Homepage.tsx
+++ b/site/src/pages/Homepage.tsx
@@ -14,6 +14,7 @@ export default function Home() {
   const { gameId } = useParams<{ gameId?: string }>();
   const [searchParams] = useSearchParams();
   const isMoe = searchParams.has("moe");
+  const newsAPIBase = import.meta.env.VITE_NEWS_BASE_URL
 
   const [newsFeedData, setNewsFeedData] = useState<ArcadeNewsAPIData | null>(
     null,
@@ -26,7 +27,7 @@ export default function Home() {
       const newsDataFileName = gameId ? `${gameId}_news.json` : "news.json";
       try {
         const response = await fetch(
-          "https://arcade-news.pinapelz.com/" + `${newsDataFileName}`,
+          newsAPIBase+"/" + `${newsDataFileName}`,
         );
         if (!response.ok) {
           throw new Error(`Failed to fetch news: ${response.statusText}`);
-- 
cgit v1.2.3

