import {NextRequest, NextResponse} from "next/server"; import {serverCall} from "@/lib/api/serverCall"; export async function GET() { const data = await serverCall("/customers", "GET"); const customers = await data.json(); return NextResponse.json(customers); } export async function POST(req: NextRequest) { const body = await req.json() const result = await serverCall("/customers", "POST", body); return NextResponse.json(result.json()); }