How to handle params route
Unanswered
West African Crocodile posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
West African CrocodileOP
Hi all,
How can I create route based on params like this :
/ -> index
/[username] -> username ?
Can I create two page.tsx and [username].tsx or I have to create only one page and check if there is no username for rendering index ?
In the past I used the pages folder and I know that we can do this but I don't find how with the app folder
How can I create route based on params like this :
/ -> index
/[username] -> username ?
Can I create two page.tsx and [username].tsx or I have to create only one page and check if there is no username for rendering index ?
In the past I used the pages folder and I know that we can do this but I don't find how with the app folder
2 Replies
![Avatar](https://cdn.discordapp.com/avatars/706802016109985813/29a666051471b5a1c43e7f439afafd5c.webp?size=256)
Hassib
Hi, here's the resource, it might help you.
https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes
https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes
For creating dynamic routes, you should create a directory containing brackets and params inside the brackets, like this:
/profile
__/[username]
_____page.tsx