dana-ciocan / app-router-test

A small repo to play with the Next.js app router

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App router test repo

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

Pre-requisites

You will need to have the following installed in order to run this code:

  1. Node.js
  2. NVM (node version manager)

Running this code

To run this code, do the following in the root of this repo:

  1. Run nmv use
  2. Run npm install
  3. Run npm run dev

Checking the routing

Once the app is running, you can go to:

  1. http://localhost:3000 to visit the homepage
  2. 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

About

A small repo to play with the Next.js app router


Languages

Language:CSS 69.9%Language:TypeScript 27.8%Language:JavaScript 2.4%