bug fixes
This commit is contained in:
parent
2f4cdc25ce
commit
e9a7fe9b25
@ -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="*")
|
||||
|
||||
|
||||
|
@ -26,9 +26,6 @@ export default function HomePage() {
|
||||
await fetch('http://localhost:8080/next'); // triggers backend to emit event
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<main className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">Game Turn Tracker</h1>
|
||||
|
@ -5,6 +5,7 @@ import { useRef, useState } from "react";
|
||||
|
||||
export default function Home() {
|
||||
const nameInputRef = useRef<HTMLInputElement>(null);
|
||||
const currentPlayers = useState<string | null>(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 (
|
||||
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
|
||||
Game Info
|
||||
|
||||
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
|
||||
<div className="flex gap-8 mb-4">
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
|
Loading…
x
Reference in New Issue
Block a user