second commit

This commit is contained in:
2024-12-16 13:30:44 +05:30
parent b37f080da5
commit 803d521b73
41 changed files with 7242 additions and 255 deletions

View File

@@ -0,0 +1,15 @@
// import { NextRequest, NextResponse } from "next/server";
// export async function PUT(req:NextRequest, {params} : { params: { id: number}}){
// const body = await req.json()
// if(!body.name)
// return NextResponse.json({error:'Name is equied'}, { status: 400})
// if(params.id>10)
// return NextResponse.json({error:'User noty found'}, { status: 404})
// return NextResponse.json({id:1, name: body.name})
// }

26
app/api/user/route.tsx Normal file
View File

@@ -0,0 +1,26 @@
// 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})
// }