import { getGames } from "@/lib/igdb";
import { NextRequest, NextResponse } from "next/server";

export async function GET(req: NextRequest) {
    const p = req.nextUrl.searchParams;
    const games = await getGames(p.get('page') ? parseInt(p.get('page') as string) : undefined);
    return NextResponse.json(games);
}