In the pages router, you could create a getStaticProps
function, which would then feed props into your component function. getStaticProps
in turn got an argument of the request and response objects, so you could pass any information you wanted from them to your page.
In the app router, there is no longer a getStaticProps
function: you're just supposed to fetch your data from the component function. However, the component function doesn't get passed the request/response, so it seems impossible to access them now.
Is there some other mechanism to access the request/response objects in the latest version of Next.js?