-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support route parameters in folder names #133
Comments
I like this implementation and a good feature would be the generation of the scaffolding using |
With as many customizations this module is getting for hooking into the algorithm, it might just be better to require an |
I tend to agree! |
Were you thinking it would live in the root of the folder from which plugins are being loaded, or in a separate config folder elsewhere in the project? |
I imagine it would be a file within each directory that is loaded:
π€·ββοΈ I'm just making an observation. It could be an unworkable idea or not worth the effort. I really do not know. |
I like using the folder names for generating the path, it's a well-established pattern in the node community.
Configuration files could work as well, but yaml are very easy to misconfigure. Furthermore, at that point, you could just use the |
I like the idea of using the filesystem since it is a pattern popularized by Next.js. I don't like having a separate folder for routes: usually, I divide the code by "services ."I think that using a We might support both, starting from the filesystem thing? |
FYI, I think the yml/json file is orthogonal to this issue, maybe we can split it? |
I agree, I think the FS-based route hierarchy is easy to grasp, predictably follows the conventions you'd expect to see in a web application, and is handled very well by this plugin. I like @mcollina's suggestion of adding the option to include parameters, as I think that complements the functionality here quite well and doesn't add too many more new moving parts.
I think that it would likely be more appropriate as its own plugin if it's not using the FS for routing, but I'm not sure what that would look like. |
Is there a release date for this PR? |
Thanks for the ping, I missed the last round of edit in the PR. It just miss docs. |
π Feature Proposal
We should support automatic routes for route params, as example
/user/:userId/cart
I would recommend we convert
_
to:
on loading.The text was updated successfully, but these errors were encountered: