In my Next.js project, I am using Cloudinary to generate secure URLs for images. The URL is stored in the variable result.secure_url within my app/page.js file. The button functionality is defined in app/components/Cloudinary.js and imported into app/page.js. However, I am unsure how to code the button click event to direct the user to the Cloudinary URL. I believe I need to make a GET request to retrieve the URL as shown below.
import { NextResponse } from "next/server";
export async function GET() {
return NextResponse.json({ **unsure what would need to be in here** })
}