title: Using socket.io with express 4 generator
body: <p>New to node, so my apologies.
  I'm working on my app and I want to send the location using socket.io. I've found 1000 examples, but all refer to when express had no routes, and it all was at the app.js. All examples refer to chat applications.
  I was able to run an example piecing together several questions I searched but, I don't understand how to get the io that I finally got working on my app.js to interact with my index.js so I can use it with multiple emit parameters. express.io is outdated and I can't find anything current.
  On bin/www</p>
  
  <pre><code>/**
   * Socket.io
   */
  var io = app.io
  io.attach( server );
  </code></pre>
  
  <p>My app.js</p>
  
  <pre><code>var socket_io = require('socket.io');
  
  var app = express();
  
  var io = socket_io();
  app.io = io;
  </code></pre>
  
  <p>So I can use:</p>
  
  <pre><code>io.on('connection', function (socket) {
      console.log('IO Ready');
  });
  </code></pre>
  
  <p>I don't know how to use the sockets on my index.js (routes), I can't modularize it.</p>
  
  <p>Thanks in advance.</p>