Open kesavkolla opened 11 years ago
You can add custom respondTo formats like this:
require('kontroller').Helpers.respondToFormats.push('msgpack')
but you might have to add kontroller as your app dependency
@scaarji , In which file put that line? I tried in environment but dont work...
I have not used compound for a while so I don't know if this solution still works. But it should work regardless of where you put it. Try inspecting require('kontroller').Helpers.respondToFormats somewhere in you action to see if your changes worked.
I wanted to add custom respondto format for handling msgpack requests. I thought I could write
c.respondTo (format) -> format.msgpack -> c.send buffer.toJSON()
The above code didn't work. Is there any support for responding to custom formats?
Thanks -Kesav