title: Node + Express Router - returning images
body: <p>I'm building an imgur mirror - i.e. if somebody wants to view imgur.com/asdf.jpg on my domain, they just go to mydomain.com/asdf.jpg and it opens the image. Here's a code snippet I've some up with so far; however, it's asking me to download the file and isn't outputting it as an image in the browser. Looking for help with this issue. Thanks.</p>
  
  <pre><code>var express = require('express');
  var request = require('request');
  var router = express();
  
    router.get('/*', function(req, res) {
  
        var image = "http://i.imgur.com/"+req.params[0];
        console.log(image); // captures correctly the image name
        request
        .get(image)
        .on('response', function(response) {
          res.writeHead(response.statusCode, "{\'Content-Type: \'"+response.headers['content-type']+"\'}");
        })
        .pipe(res);
    });
  
  ... some server stuff
  </code></pre>