RenderPipeline2
Deploy / deploy (push) Failing after 1m52s

This commit is contained in:
twotalesanimation
2026-08-01 15:44:26 +02:00
parent 0d0f3e1a33
commit 9a49cdc6a3
11 changed files with 2626 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
import { NextRequest, NextResponse } from "next/server";
import { getLatestExportForShot } from "@/lib/render-pipeline/exports";
function isAuthorized(req: NextRequest): boolean {
const apiKey = process.env.API_SECRET_KEY;
if (!apiKey) return false;
const authHeader = req.headers.get("authorization") ?? "";
if (authHeader.startsWith("Bearer ")) return authHeader.slice(7) === apiKey;
return (req.headers.get("x-api-key") ?? "") === apiKey;
}
export async function GET(req: NextRequest) {
if (!isAuthorized(req)) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const { searchParams } = new URL(req.url);
const shotId = searchParams.get("shotId");
if (!shotId) {
return NextResponse.json({ error: "shotId query param is required" }, { status: 400 });
}
const exportRecord = await getLatestExportForShot(shotId);
return NextResponse.json({ export: exportRecord });
}