Skip to content

Commit 23f25e8

Browse files
author
Miriad
committed
debug: temporary test-imagen endpoint for Vercel diagnosis
1 parent 7b06b39 commit 23f25e8

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

app/api/test-imagen/route.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { NextResponse } from "next/server";
2+
import { generateInfographic } from "@/lib/services/gemini-infographics";
3+
4+
export const maxDuration = 60;
5+
6+
export async function GET() {
7+
try {
8+
console.log("[test-imagen] Starting test...");
9+
const result = await generateInfographic({
10+
prompt: "Infographic 2D architecture style, black background. A simple server rack. Highlighted elements filled with #15b27b.",
11+
aspectRatio: "16:9",
12+
});
13+
return NextResponse.json({
14+
success: true,
15+
mimeType: result.mimeType,
16+
imageSize: result.imageBase64.length,
17+
});
18+
} catch (err) {
19+
console.error("[test-imagen] Error:", err);
20+
return NextResponse.json({
21+
success: false,
22+
error: err instanceof Error ? err.message : String(err),
23+
stack: err instanceof Error ? err.stack?.split("\n").slice(0, 5) : undefined,
24+
}, { status: 500 });
25+
}
26+
}

0 commit comments

Comments
 (0)