Files
Firefly_Srtools/src/app/api/[locale]/lightcones/[id]/route.ts
AzenKain afdb92cc2d
Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m25s
UPDATE: next16 and minifyjson
2025-11-18 14:09:00 +07:00

21 lines
571 B
TypeScript

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" }
});
}