Repository navigation
Take HTTP methods from files names #5
Closed
angelhdzmultimedia
started this conversation in
Ideas
Replies: 2 comments 2 replies
|
Hi! 👋🏻 Wow, your idea is brilliant!! 🔥 Thank you so much. It will definitely become a part of the functionality. I'll do it on this Tuesday or Wednesday :) And notify you when it's ready. Also, if you suddenly have the time and desire, I can help you with MR. I’m ready to provide guidance on the code as to what is needed and how it could be roughly implemented. It has several nuances: the library works not only with http but with any other protocols. |
0 replies
|
@angelhdzmultimedia Hi! I've released a new version with this functionality. https://github.com/Danilqa/node-file-router/releases/tag/v0.3.0 |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello, congrats on the library!
I played with it a bit, but missed Nuxt's way of defining the routes, specifying the HTTP method on the files names like this:
/api/auth/login.post.ts.I couldn't find if that was possible with this library.
So I made my own!
Wrote a function that parses the request, using
node:fsof course to read recursively the folders and files,and then parsed the HTTP method from the files names, and it works beautifully.
Obviously it's very raw, maybe I polish it a bit later, work on performance, and make the paths work with other operating systems (currently made it for Windows!).
You can implement this feature if you want, it would be cool.
Wishing you health, peace, and success. 🔥☕😊🤝
All reactions