mikecao/flight — pull request #62 by ozh (2013-10-29 18:31:09+00:00)
Title: JSONP support

Hi

Thanks a zillion for this neat little framework. I'm using it to develop api.yourls.org, it's lovely and has everything needed to roll out APIs :-)

I would like it to support JSONP out of the box, would you be interested in a pull request?

My implementation works this way:
- new default setting to set the callback name: `flight.jsonp.callback`
- new function `_jsonp()` outputting JSON padded with the callback value (eg `/route/?jsonp=foo` will output `foo(...JSON response here...);`

Thanks for your time!