Skip to content

Dynamic routes []

Course: NextJS Part 3 - chapter 3

A folder or file in the form [slug] defines a dynamic parameter in the route (e.g., /blog/[slug] might match /blog/hello-world or /blog/another-post).

Inside your components, you can access this parameter via params.slug.

Create a frontend for a todo / posts application. Backend is at

https://jsonplaceholder.typicode.com/posts/1

When the user comes to [localhost:3000/post/1](http://localhost:3000/post/1) , they should see the post rendered from [https://jsonplaceholder.typicode.com/posts/1](https://jsonplaceholder.typicode.com/posts/1) . It should be a server components, feel free to use axios