Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nextjs - first level dynamic route

I want to have user profiles in my app at domain.com/:username .How do I do it? creating a new folder in /pages will create a new URL section like /user/:username which I don't want.

like image 760
Julian Betancourt Avatar asked Jun 05 '26 23:06

Julian Betancourt


1 Answers

Just name your file inside pages as [username].js

like image 84
Hadi Pawar Avatar answered Jun 07 '26 11:06

Hadi Pawar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!