flatiron/restful — pull request #26 by nrw (2012-10-23 22:48:08+00:00)
Title: Allow a custom respond method when used as a flatiron plugin

So you can do things like this:

```javascript
app.use(restful, {
strict: true,
respond: function (req, res, status, key, value) {
var result;
res.writeHead(status);

if (arguments.length === 5) {
result = value;
}
else {
result = key;
}

res.end(result ? JSON.stringify(result) : '');
}
});
```
Which will behave like this:

```javascript
// GET '/user/10'

// the default response:
{
user: {
name: 'jack'
}
}

// the response with the above respond method
{
name: 'jack'
}
```