title: Why am I not receiving a console.log that a new socket user has connected?
body: <p>I'm more or less following the socket.io documentation and trying to apply it to my slightly different project but I believe I'm making some mistake. I've used express-generator to create my project's skeleton and therefore I got app.js file, www file and route files.</p>
  
  <p>I've put this code in www file:</p>
  
  <pre><code>var io = require('socket.io')(http);
  console.log('Socket is running!');
  io.on('connection', function(socket){
      console.log('A User Has Connected: ' + socket.id);
  });
  </code></pre>
  
  <p>This code in my footer file:</p>
  
  <pre><code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script src="/javascripts/jquery-3.2.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="/javascripts/javascript.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this in my JavaScript file:</p>
  
  <pre><code>$(document).ready(function(){
  
      var socket = io();
  
  });
  </code></pre>
  
  <p>Now I understand that when a request is made, the console should log "A User Has Connected: " + the id of the socket but I'm not getting anything other than "Socket is running!". I assume I'm missing something but can't figure it out and the documentation is using the same code.</p>
  
  <pre><code>var port = normalizePort(process.env.PORT || '8087');
  app.set('port', port);
  server.listen(port);
  server.on('error', onError);
  server.on('listening', onListening);
  </code></pre>