mauricemach / zappa

Node development for the lazy.
zappajs.org
MIT License
949 stars 81 forks source link

Content negotiation #128

Open darvin opened 11 years ago

darvin commented 11 years ago

From my understanding it's impossible to do via connect/express middleware, and it could be nice addition to zappa. Say,

@get '/': ->
  @render index: {foo: 'bar'}

And if request has header Accept-type: application/json, server will respond with JSON {"foo":"bar"} instead of view index rendered with {foo:"bar"} Will it be accepted into upstream? If yes, I can do that