webpro/dyson — pull request #11 by nayakravi (2013-06-24 03:30:51+00:00)
Title: Minor tweaks

Hi Lars,
I made a couple of changes to the framework to accommodate my needs.
The 2 changes are:
1. I wanted to use the status callback to simulate exceptions like internal server error (500), etc. However, the framework continued executing code even when the response was sent after the status callback. I simply added a check to see if the response was committed after the status check and exited the generate method if so.
2. In our specific case (and I believe this is common in the industry), we use the same pluralized form of a resource name for getting a collection as well as an individual resource. For example GET /persons and GET /persons/:id?. Since the template is not passed the req object currently, it is impossible to to cater to both these conditions without overriding the response callback itself. So, I simply passed in the req, res and next parameters to the template method.

It will be fantastic if you can incorporate these into the framework. Or at least let me know valid workarounds to my issues, if not.

Thanks,
Ravi