title: Displaying all images in a directory
body: <p>I'm trying to display all of the images in a directory. The images are uploaded and I want to display them accordingly. However, with my current code mt page only ever generates one image element, and the link to that image is broken. Since I'm new to javascript and nodejs in general, there's probably some extra step that I'm missing. Any help is greatly appreciated.</p>
  
  <pre><code>    function show(response, request) {
      console.log("Request handler 'show' was called.");
      fs.readdir("./tmp", function(error, files) {
          response.writeHead(200, {'content-type': 'image/png'});
          if (error) {
              console.error(error.message);
          } else {
              files.forEach(function(file) {
                  response.write("./tmp/" + file, 'binary');
                  console.log('Image: ./tmp/' + file +' written');
              });
              response.end();
          }
      });
      console.log('All images written');
  }
  </code></pre>