Dynamic Routes

There are many applications that require pages to be created dynamically. Next.js provides a robust feature set for this functionality.

Let’s talk about what dynamic routes are and how they work.

First, what if you had a news site that had different articles at different URLs?

For example:

  • somegreatnews.com/article/974232
  • somegreatnews.com/article/243423

Each article is a different subject matter, but the layout of the page would need to be the same. It might include a title, an image, some text for the body of the article, and perhaps some other common things that would work nicely on a news site.

Imagine that this site has thousands of articles. You wouldn’t want to create a new page for each one, right? ...