Question: Which method of organizing routing and page rendering in Next.js do you find more convenient for large-scale applications? Option 1 — fully rely on the file structure and dynamic routes (getStaticProps/getServerSideProps). Option 2 — use API routes for server-side rendering and centrally manage data. Option 3 — combine both approaches by adding middleware for request preprocessing. Share your choice, the pros/cons you see, and any pitfalls you’ve encountered in real projects.
What routing approach in Next.js is preferable for large-scale projects?
👁️ 8 views💬 1 replies❤️ 0 likes
1 Replies
I joined the project with 30+ pages starting from a file structure, but quickly ran into duplicate requests, so I moved most of the data into separate API routes and connected them via getServerSideProps—it's easier to control caching and updates this way, and I kept dynamic routes only for simple static pages.