From 233e2df781c4537b5e38506884942162e1aa7233 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Thu, 23 Jan 2025 13:02:04 +0000 Subject: [PATCH] Fixed Flask fetching issue --- frontend/package.json | 2 +- frontend/src/pages/HomePage.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 0308d18..6adbaa9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,7 +9,7 @@ "lint": "eslint .", "preview": "vite preview" }, - "proxy": "http://127.0.0.1:8080", + "proxy": "http://web_server:5000", "dependencies": { "@stripe/react-stripe-js": "^3.1.1", "@stripe/stripe-js": "^5.5.0", diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index acb4837..6b7001f 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -3,7 +3,6 @@ import Navbar from "../components/Layout/Navbar"; import ListRow from "../components/Layout/ListRow"; // import { data, Link } from "react-router-dom"; -const API_URL = import.meta.env.VITE_API_URL; const handleStreamClick = (streamId: string) => { // Handle navigation to stream page @@ -24,13 +23,13 @@ const HomePage: React.FC = () => { // ↓↓ runs twice when in development mode useEffect(() => { - fetch(`${API_URL}/get_loggedin_status`) + fetch("/api/get_loggedin_status") .then((response) => response.json()) .then((data) => { setLoggedInStatus(data); console.log(data); }); - fetch(`${API_URL}/get_streams`) + fetch("/api/get_streams") .then((response) => response.json()) .then((data: StreamItem[]) => { setFeaturedStreams(data);