This is a small repo to go with my blog post comparing the pages and app routers in Next.js: https://danaciocan.com/nextjs-pages-vs-app-router
You will need to have the following installed in order to run this code:
- Node.js
- NVM (node version manager)
To run this code, do the following in the root of this repo:
- Run
nmv use
- Run
npm install
- Run
npm run dev
Once the app is running, you can go to:
- http://localhost:3000 to visit the homepage
- http://localhost:3000/product/1234 to visit the Product page for an imaginary product with ID 1234 - you can change the ID to anything you like and see it update in the UI - you can also see the shared sub layout being displayed