FUNCTION FN_HANDLE() LOCAL oQR := FN_REQUIRE( "qr-image" ) LOCAL xRet, cSvg IF ! HB_ISOBJECT( oQR ) RETURN hb_jsonEncode( { "status" => 500, "headers" => { => }, "body" => "require qr-image: " + FN_LASTERROR() } ) ENDIF // qr-image.imageSync(text, {type:'svg'}) → Buffer → toString xRet := oQR:imageSync( "https://solmade.kr", { "type" => "svg" } ) IF HB_ISOBJECT( xRet ) // Buffer 핸들로 옴 → toString cSvg := xRet:toString( "utf8" ) xRet:__end__() ELSE cSvg := hb_CStr( xRet ) ENDIF oQR:__end__() RETURN hb_jsonEncode( { ; "status" => 200, ; "headers" => { "Content-Type" => "application/json" }, ; "body" => hb_jsonEncode( { "msg" => "PRG -> npm qr-image (real Node) via N-API", "svg_len" => Len( cSvg ), "svg_head" => Left( cSvg, 30 ) } ) ; } )