Next.js is a React website framework for full-stack applications. Server-side rendering can reduce data-transfer round trips, render pages before browser-side React starts, and improve speed, retention, search-engine optimization, and user experience. section 11.0
A Pages Router application typically combines:
- Route files in the pages folder, each exporting a default React component. section 11.3.2
- A getServerSideProps function beside the component to load route data on the server and pass it as props. section 11.3.2
- Dynamic URL segments such as /pages/shop/[categoryId].jsx, whose parameters select data for the rendered page. section 11.3.2
- Redirect handling when requested data is unavailable, plus cookies, external services, and APIs where the application requires them. section 11.3.2 section 11.3
Weather application
A weather app demonstrates the architecture by using URLs for a front page, country pages, and city pages; loading weather data on the server; reusing it on the client; persisting local state in a cookie; and exposing an API for React-server interaction. section 11.3
Figure 11.7 The Pages Router part of the documentation. If the menu heading is Using App Router, you can't use whatever information you read in a Pages Router–based application.
Use the Pages Router documentation for this implementation; App Router guidance targets the newer React Server Components model and does not directly apply. section 11.2.1


