feat: add CRUD api and slug page
This commit is contained in:
22
app/api/module/[id]/route.ts
Normal file
22
app/api/module/[id]/route.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: { id: number } }
|
||||
) {
|
||||
return NextResponse.json(`GET ${params.id}`);
|
||||
}
|
||||
|
||||
export async function PUT(
|
||||
request: NextRequest,
|
||||
{ params }: { params: { id: number } }
|
||||
) {
|
||||
return NextResponse.json(`PUT ${params.id}`);
|
||||
}
|
||||
|
||||
export async function DELETE(
|
||||
request: NextRequest,
|
||||
{ params }: { params: { id: number } }
|
||||
) {
|
||||
return NextResponse.json(`DELETE ${params.id}`);
|
||||
}
|
||||
Reference in New Issue
Block a user