You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change order of the options argument, so it would be after the path.
Allow options to be string, then it would be used as a route name.
Use the arguments object, so if there would be more than one middleware, then putting them in an array would be optional, like in Express.
If the options argument would be a callback, then instead of slicing three args from the arguments object, it would slice two, so options would be optional.
All of the changes above would allow to create a named route like that:
If you are using this module with Express, you can create a named route like that:
It's clean and neat, but is you are using standalone mode and want to create the exact route, you end up with that:
It feels bloated, but wait, what if you want some middlewares?
My proposal would be to:
options
argument, so it would be after the path.options
to be string, then it would be used as a route name.arguments
object, so if there would be more than one middleware, then putting them in an array would be optional, like in Express.options
argument would be a callback, then instead of slicing three args from thearguments
object, it would slice two, sooptions
would be optional.All of the changes above would allow to create a named route like that:
I can create a pull request, but first I would love to know your opinions.
The text was updated successfully, but these errors were encountered: