In my Next.js application, I'm using the App Router and I want to make a GET request to a third-party API. But I get this error:
Access to fetch at 'https://thirdpartyapi.com/search' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.
I saw somewhere that using a proxy server works, but I'm not sure that's the approach to take with Next.js. What is the easiest way to resolve this issue in Next.js app router?