import { NextResponse } from 'next/server'; import { getAllPlayers } from '@/lib/data'; export const dynamic = 'force-dynamic'; export async function GET() { try { const data = await getAllPlayers(); return NextResponse.json(data); } catch (e) { console.error(e); return NextResponse.json([], { status: 500 }); } }