I think it would be great to have parameter in URL functionality (for example /users/:id) while still keeping the simplicity of next itself.
My proposition is to do this for structure:
pages/
index.js
users/
_id.js
id.js will be seen as a parameter path and will receive id as prop. You could also go further and make it like this to map /users/:id/friends/:friendid:
pages/
index.js
users/
_id/
index.js
friends/
_friendid.js
If the id is not specified (eg. /users/) then we'll first check if there is an index.js and otherwise use _id.js.
I created this issue to see if others are interested in this and to see what everyones thoughts/feedback is on this. I'm willing to build this if this is a wanted feature! 😄
I think it would be great to have parameter in URL functionality (for example
/users/:id) while still keeping the simplicity ofnextitself.My proposition is to do this for structure:
id.jswill be seen as a parameter path and will receiveidas prop. You could also go further and make it like this to map/users/:id/friends/:friendid:If the id is not specified (eg.
/users/) then we'll first check if there is anindex.jsand otherwise use_id.js.I created this issue to see if others are interested in this and to see what everyones thoughts/feedback is on this. I'm willing to build this if this is a wanted feature! 😄