Fixed Flask fetching issue
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"proxy": "http://127.0.0.1:8080",
|
"proxy": "http://web_server:5000",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@stripe/react-stripe-js": "^3.1.1",
|
"@stripe/react-stripe-js": "^3.1.1",
|
||||||
"@stripe/stripe-js": "^5.5.0",
|
"@stripe/stripe-js": "^5.5.0",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import Navbar from "../components/Layout/Navbar";
|
|||||||
import ListRow from "../components/Layout/ListRow";
|
import ListRow from "../components/Layout/ListRow";
|
||||||
// import { data, Link } from "react-router-dom";
|
// import { data, Link } from "react-router-dom";
|
||||||
|
|
||||||
const API_URL = import.meta.env.VITE_API_URL;
|
|
||||||
|
|
||||||
const handleStreamClick = (streamId: string) => {
|
const handleStreamClick = (streamId: string) => {
|
||||||
// Handle navigation to stream page
|
// Handle navigation to stream page
|
||||||
@@ -24,13 +23,13 @@ const HomePage: React.FC = () => {
|
|||||||
|
|
||||||
// ↓↓ runs twice when in development mode
|
// ↓↓ runs twice when in development mode
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch(`${API_URL}/get_loggedin_status`)
|
fetch("/api/get_loggedin_status")
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setLoggedInStatus(data);
|
setLoggedInStatus(data);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
});
|
});
|
||||||
fetch(`${API_URL}/get_streams`)
|
fetch("/api/get_streams")
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data: StreamItem[]) => {
|
.then((data: StreamItem[]) => {
|
||||||
setFeaturedStreams(data);
|
setFeaturedStreams(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user