mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
16 lines
451 B
TypeScript
16 lines
451 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
export function generateStaticParams() {
|
|
console.log('generateStaticParams static/[slug]')
|
|
return [{ slug: 'first' }, { slug: 'second' }]
|
|
}
|
|
|
|
export const GET = async (
|
|
req: NextRequest,
|
|
props: { params: Promise<{ slug: string }> }
|
|
) => {
|
|
const params = await props.params
|
|
const resolvedParams = await params
|
|
return NextResponse.json({ params: resolvedParams, now: Date.now() })
|
|
}
|