#Get search params
1 messages · Page 1 of 1 (latest)
To access URL search parameters in Next.js, you should use the get method of the searchParams object. In your case, if you want to access the folder parameter, you should do it like this:
export async function GET(request, context) {
const folder = request.nextUrl.searchParams.get('folder');
console.log(folder);
}
This will return the value of the folder parameter if it exists, or null if it doesn't.