Hi, I'd like to address a few concerns about this package:
- The key names in the
routes object seem redundant. This is mostly an aesthetic concern, but it does force the user to think of a name for a route, even if the route is self-descriptive.
- Not sure about the purpose of differentiating
:, %, or * parameters, other than to have some sort of type casting. After all, the URL is just a string.
- Making the
before method synchronous really limits what you can do with it. For example, what if I want to query the database to check if the currently authenticated user has permissions on a resource? Consider returning a promise or callback.
- Come to think of it, it might be missing an
after method, which gets called after a resource is loaded, to transform the response.
- It's unclear how a route triggers an action. How does a route know what is the corresponding action?
- Is there any point to the
helpers object, or is it there for organizational purposes?
P.S. I've authored a package that may be similar.
Hi, I'd like to address a few concerns about this package:
routesobject seem redundant. This is mostly an aesthetic concern, but it does force the user to think of a name for a route, even if the route is self-descriptive.:,%, or*parameters, other than to have some sort of type casting. After all, the URL is just a string.beforemethod synchronous really limits what you can do with it. For example, what if I want to query the database to check if the currently authenticated user has permissions on a resource? Consider returning a promise or callback.aftermethod, which gets called after a resource is loaded, to transform the response.helpersobject, or is it there for organizational purposes?P.S. I've authored a package that may be similar.