title: How to serve images in nodejs express
body: <p>I have this code    </p>
  
  <pre><code>var express = require('express');
  var http = require('http');
  
  var app = express();
  var server = http.createServer(app);
  
  app.use(express.static(__dirname + '/uploads'));
  
  console.log("listen to 8080");
  server.listen(8080);
  </code></pre>
  
  <p>I have my image in <code>/uploads/test.jpg</code> but when I go to <code>http://localhost:8080/uploads/test.jpg</code> I get <code>Cannot GET /uploads/test.jpg</code>.</p>