import { NextResponse } from "next/server"; import { withAuth } from "@/lib/api-auth"; import { listDeploymentLogs } from "@/lib/deployments"; export const dynamic = "force-dynamic"; /** Log lines after `?after=` (first call: the last 500). */ export const GET = withAuth>(async (req, { params }) => { const after = Number(new URL(req.url).searchParams.get("after") ?? 0) || 0; return NextResponse.json(await listDeploymentLogs((await params).id, after)); });