// // import chromium from "@sparticuz/chromium";
// // import chromium from "chrome-aws-lambda";
// const chromium = require("chrome-aws-lambda");
// import { NextRequest, NextResponse } from "next/server";
// // import * as puppeteer from "puppeteer-core";
// import puppeteer from "puppeteer";

// export default async function getBrowser() {
//   return puppeteer.launch({
//     args: [...chromium.args, "--hide-scrollbars", "--disable-web-security"],
//     defaultViewport: chromium.defaultViewport,
//     headless: false,
//     // ignoreHTTPSErrors: true,
//   });
// }

// export async function GET(request: NextRequest) {
//   const browser = await getBrowser();
//   const page = await browser.newPage();
//   await page.goto("https://naver.com");
//   const buffer = await page.screenshot({ type: "png" });
//   await browser.close();
//   const base64Image = buffer.toString("base64");
//   return NextResponse.json({ image: base64Image });
// }
