O'Reilly logo
  • Patrick S thinks this is interesting:

  • String: response.send('success'); with text/html
  • Object: response.send({message: 'success'}); or response.send({message: 'error'}); with JSON representation
  • Array: response.send([{title: 'Practical Node.js'}, {title: 'Rapid Prototyping with JS'}]); with JSON representation
  • Buffer: response.send(new Buffer('Express.js Guide')); with application/octet-stream

From

Cover of Pro Express.js

Note

response.status and response.send() examples