Files
nextjs/app/api/user/route.tsx
2024-12-16 13:30:44 +05:30

26 lines
554 B
TypeScript

// import { NextRequest, NextResponse } from "next/server";
// export function GET(req:NextRequest){
// return NextResponse.json([
// {
// id:1,
// name: 'John'
// },
// {
// id:1,
// name:'Mosh'
// }
// ])
// }
// export async function POST(req:NextRequest){
// const body = await req.json()
// if(!body?.name)
// return NextResponse.json({error:'Name is Required'}, {status:400})
// return NextResponse.json({id:1, name: body.name})
// }