UPDATE: Update readme and Next 16.07 (CVE-2025-66478)
This commit is contained in:
20
src/app/api/[locale]/lightcones/[id]/route.ts
Normal file
20
src/app/api/[locale]/lightcones/[id]/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadLightcones } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const lightcones = await loadLightcones([id], locale)
|
||||
const lightcone = lightcones[id]
|
||||
|
||||
if (!lightcone) {
|
||||
return NextResponse.json({ error: 'Lightcone not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return new NextResponse(JSON.stringify(lightcone), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user