import { NextResponse } from "next/server"; import { getProductBySku } from "@/lib/master-json"; export async function GET( _req: Request, ctx: RouteContext<"/api/products/[sku]">, ) { const { sku } = await ctx.params; const product = getProductBySku(sku); if (!product) { return NextResponse.json( { error: "Product not found", sku }, { status: 404 }, ); } return NextResponse.json(product, { headers: { "Cache-Control": "public, s-maxage=60, stale-while-revalidate=300" }, }); }