From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Pages Router vs. App Router

In a Next.js application, router is the most important and essential concept. And while creating the project, we were asked whether we want to use the app router or not. And we answered yes. It means we opt for the app router. In any full-stack application, router that is having different path for different functionality plays an important role. Next.js gives you power to create routers with an ease of following the filename conventions. In the versions prior to Next.js 13, there was only one way of creating a router, which was the pages router. But from Next.js 13 and onwards, now we have the app router which is relatively an advanced way and future of creating the Next.js applications. Both the pages and app router approaches make the full stack application. It's just that they follow different approaches to implement routes and make the Next.js application. Of course, with the app router, there are new modern features supported as compared to pages router, like supporting react server component, etc. But that we will see as we proceed. Our main focus is going to be the app router, but at the same time, we'll make sure that we have discussed pages router as well in detail.

Contents