title: Configuring 'simplest' node.js + socket.IO + Express server
body: <p>Realized after setting up a simple node.js socket.IO server that it isn't sufficient to handle even the simplest webpages containing script tags.</p>
  
  <p>So I investigating express which is a simple web framework for node.js.</p>
  
  <p>After looking thru the express documentation <a href="http://expressjs.com/guide.html" rel="nofollow">http://expressjs.com/guide.html</a>
  I was still confused as to how I simply combine express with socket.IO on a node.js server.</p>
  
  <p>Couple hours of googling later I came across this tutorial
  <a href="https://www.digitalocean.com/community/articles/how-to-install-express-a-node-js-framework-and-set-up-socket-io-on-a-vps" rel="nofollow">https://www.digitalocean.com/community/articles/how-to-install-express-a-node-js-framework-and-set-up-socket-io-on-a-vps</a></p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes')
    , http = require('http');
  
  var app = express();
  var server = app.listen(3000);
  var io = require('socket.io').listen(server); // this tells socket.io to use our express server
  
  app.configure(function(){
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.static(__dirname + '/public'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
  });
  
  app.configure('development', function(){
    app.use(express.errorHandler());
  });
  
  app.get('/', routes.index);
  
  
  console.log("Express server listening on port 3000");
  io.sockets.on('connection', function (socket) {
      console.log('A new user connected!');
      socket.emit('info', { msg: 'The world is round, there is no up or down.' });
  });
  </code></pre>
  
  <p>My question is, would anyone reading this configure their server differently?
  I don't need anything special, no session handling etc, just the ability to serve html pages containing links to external CSS and javascript files.</p>