mirror of
https://github.com/DeBrosOfficial/network.git
synced 2026-01-30 14:33:03 +00:00
27 lines
611 B
TypeScript
27 lines
611 B
TypeScript
import { NextResponse } from 'next/server'
|
|
|
|
export async function GET() {
|
|
return NextResponse.json({
|
|
users: [
|
|
{ id: 1, name: 'Alice', email: 'alice@example.com' },
|
|
{ id: 2, name: 'Bob', email: 'bob@example.com' },
|
|
{ id: 3, name: 'Charlie', email: 'charlie@example.com' }
|
|
],
|
|
total: 3,
|
|
timestamp: new Date().toISOString()
|
|
})
|
|
}
|
|
|
|
export async function POST(request: Request) {
|
|
const body = await request.json()
|
|
|
|
return NextResponse.json({
|
|
success: true,
|
|
created: {
|
|
id: 4,
|
|
...body,
|
|
createdAt: new Date().toISOString()
|
|
}
|
|
}, { status: 201 })
|
|
}
|