File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments