From e9a7fe9b25ccd5fe444db8d857c79a7f0c6e862a Mon Sep 17 00:00:00 2001 From: Aidan Haas Date: Tue, 8 Jul 2025 12:37:29 -0400 Subject: [PATCH] bug fixes --- backend/server.py | 2 +- frontend/app/live/page.tsx | 3 --- frontend/app/page.tsx | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/server.py b/backend/server.py index 4258bb2..43b16aa 100644 --- a/backend/server.py +++ b/backend/server.py @@ -7,7 +7,7 @@ from flask_cors import CORS from flask_socketio import SocketIO app = Flask(__name__) -CORS(app, origins=["http://localhost:3000"]) +CORS(app, origins=["http://localhost:3000", "10.*"]) socketio = SocketIO(app, cors_allowed_origins="*") diff --git a/frontend/app/live/page.tsx b/frontend/app/live/page.tsx index 67cc78e..df37ef7 100644 --- a/frontend/app/live/page.tsx +++ b/frontend/app/live/page.tsx @@ -26,9 +26,6 @@ export default function HomePage() { await fetch('http://localhost:8080/next'); // triggers backend to emit event }; - - - return (

Game Turn Tracker

diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index c331ee7..2336be7 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -5,6 +5,7 @@ import { useRef, useState } from "react"; export default function Home() { const nameInputRef = useRef(null); +const currentPlayers = useState(null); const addPlayer = async () => { const playerName = nameInputRef.current?.value?.trim(); @@ -14,7 +15,8 @@ const addPlayer = async () => { } try { - const res = await fetch('http://localhost:8080/add', { + console.log(`${process.env.NEXT_PUBLIC_API_BASE}`); + const res = await fetch(`${process.env.NEXT_PUBLIC_API_BASE}/add`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: playerName, group: selectedGroup }), @@ -43,6 +45,8 @@ const addPlayer = async () => { return (
+ Game Info +