title: Node.js Express 3 not serving socket.io.js
body: <p>I'm trying to follow the instructions here</p>
  
  <p><a href="http://socket.io/#how-to-use" rel="nofollow noreferrer">http://socket.io/#how-to-use</a></p>
  
  <p>However, I seem too dumb to understand why I cannot reference socket.io.jss on the client side. I've read similar posts here but they don't seem right: <a href="https://stackoverflow.com/questions/13458366/nodejs-express-not-serving-socket-io-socket-io-js">NodeJS Express not serving &#39;/socket.io/socket.io.js&#39;</a></p>
  
  <p>Here's the full app listing:</p>
  
  <pre><code>var application_root = __dirname,
      express = require('express'),
      //Web framework
      path = require('path'),
      //Utilities for dealing with file paths
      pg = require('pg'); //Postgres integration
  
  //Create server
  var app = express();
  
  
  // Configure server
  app.configure(function () {
      //parses request body and populates request.body
      app.use(express.bodyParser());
  
      //checks request.body for HTTP method overrides
      app.use(express.methodOverride());
  
      //perform route lookup based on url and HTTP method
      app.use(app.router);
  
      //Where to serve static content
      app.use(express.static(path.join(application_root, 'public')));
  
      //Show all errors in development
      app.use(express.errorHandler({
          dumpExceptions: true,
          showStack: true
      }));
  });
  
  
  //Start server
  var port = 4711;
  app.listen(port, function () {
      console.log('Express server listening on port %d in %s mode', port, app.settings.env);
  });
  
  //Start socket.io
  var server = require('http').createServer(app),
      io = require('socket.io').listen(server);
  </code></pre>
  
  <p>Now if I try to reference the client-side js, I get a 404.</p>
  
  <pre><code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Anyone know why Express 3 is not allowing socket.io to serve its client lib?</p>