diff --git a/app.js b/app.js index 824a4c0..d9e310f 100644 --- a/app.js +++ b/app.js @@ -16,7 +16,9 @@ UUID = require('node-uuid'), verbose = false, - app = express.createServer(); + http = require('http'), + app = express(), + server = http.createServer(app); /* Express server set up. */ @@ -26,13 +28,14 @@ //so keep this in mind - this is not a production script but a development teaching tool. //Tell the server to listen for incoming connections - app.listen( gameport ); + server.listen(gameport) //Log something so we know that it succeeded. console.log('\t :: Express :: Listening on port ' + gameport ); //By default, we forward the / path to index.html automatically. app.get( '/', function( req, res ){ + console.log('trying to load %s', __dirname + '/index.html'); res.sendfile( __dirname + '/index.html' ); }); @@ -60,7 +63,7 @@ //This way, when the client requests '/socket.io/' files, socket.io determines what the client needs. //Create a socket.io instance using our express server - var sio = io.listen(app); + var sio = io.listen(server); //Configure the socket.io connection settings. //See http://socket.io/ diff --git a/package.json b/package.json index d86d726..e023ffd 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,11 @@ "license": "MIT", "version": "1.0.0", "dependencies": { - "express": "2.5.x", + "express": "3.3.x", "socket.io": "0.9.x", "node-uuid": "1.3.3" }, "engine": { - "node": "0.6.x" + "node": "0.10.x" } -} \ No newline at end of file +}