Permalink
Browse files

Merge pull request #5 from nerakhon/master

Modified JS code to handle changes in express 3
  • Loading branch information...
2 parents 1cbcdc1 + ee58f57 commit 066b70b180acd5f20abbbc1383452f279191a8de @gflarity committed Feb 20, 2013
Showing with 10 additions and 5 deletions.
  1. +10 −5 heat_tracer.js
View
@@ -2,15 +2,20 @@ 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);
-
+/* to decreate verbosity of socket.io
+*/
+io.set('log level', 1);
/* 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 +86,6 @@ io.sockets.on('connection', function(socket) {
} );
-app.listen(8000);
+server.listen(8000);

0 comments on commit 066b70b

Please sign in to comment.