Permalink
Browse files

Migrated to express 3

Migrated code to express 3 (current default in npm repository), changes
are required due to express no longer inheriting from http.
  • Loading branch information...
nerakhon committed Feb 20, 2013
1 parent 1cbcdc1 commit cfd6bd2323257a44140fba08c64f9930b8f6fcfe
Showing with 7 additions and 5 deletions.
  1. +7 −5 heat_tracer.js
View
@@ -2,15 +2,17 @@ var http = require('http');
var libdtrace = require('libdtrace');
var express = require('express');
-/* create our express server and prepare to serve javascript files in ./public
+/* create our express & http server and prepare to serve javascript files in ./public
*/
-var app = express.createServer();
+var app = express()
+ , http = require('http')
+ , server = http.createServer(app)
+ , io = require('socket.io').listen(server);
+
app.configure(function(){
app.use(express.static(__dirname + '/public'));
});
-var io = require('socket.io').listen(app);
-
/* Before we go any further we must realize that each time a user connects we're going to want to
them send them dtrace aggregation every second. We can do so using 'setInterval', but we must
@@ -81,6 +83,6 @@ io.sockets.on('connection', function(socket) {
} );
-app.listen(8000);
+server.listen(8000);

0 comments on commit cfd6bd2

Please sign in to comment.