Browse Source

added a first elmeent of leaderboards collection

visualizer2
root 9 years ago
parent
commit
ee5610a692
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      server.js

+ 1
- 2
server.js View File

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


Loading…
Cancel
Save