|
|
@ -12,7 +12,7 @@ var mongoUri = "mongodb://localhost:27017/visualizer"; |
|
|
|
var db = mongojs( mongoUri ); |
|
|
|
var honeyCombs = db.collection('honeyCombs'); |
|
|
|
var leaderBoards = db.collection('leaderBoards'); |
|
|
|
// honeyCombs.insert({dio: "cane", type: "flyingPig"});
|
|
|
|
// leaderBoards.insert({dio: "cane", type: "flyingPig"});
|
|
|
|
|
|
|
|
//Specifying the public folder of the server to make the html accesible using the static middleware
|
|
|
|
app.use(cookieParser()); |
|
|
@ -83,7 +83,6 @@ io.sockets.on('connection', function(socket){ |
|
|
|
|
|
|
|
}); |
|
|
|
socket.on('leaderBoard',function(lb){ |
|
|
|
|
|
|
|
leaderBoards.find().sort({timeStamp:-1}).limit(1, function(err, docs){ |
|
|
|
|
|
|
|
var parsedLb = JSON.parse(lb); |
|
|
|