Node.js Proxying Requests Using Express

Thu Oct 10 2013 08:32:56 GMT-0400 (EDT)

I'm constantly amazed at how powerful node.js is -- here's an example of the power behind streams.

I'm writing a web-app using the sails.js MVC framework. Sails is built on express for providing HTTP responses to requests. Part of the application will request an image from a server and serve it to the user (essentially acting as a proxy).

Here's the the code needed to get this to work:

var request = require('request');

module.exports = {
  showImage: function(req, res){

An example of the simplicity of streams for data handling.