Skip to content

Commit

Permalink
On the server, log when a client connects.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorendorff committed Apr 12, 2016
1 parent e3f897f commit 2875edb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var nextUserId = 1; // Used to generate a unique id for each user.
io.on('connection', function (socket) {
// Populate the new client with a user id and the full document.
var userId = nextUserId++;
console.log("connection - assigning id " + userId);
socket.emit("welcome", {id: userId, history: doc.history()});

// Propagate ops in both directions.
Expand Down

0 comments on commit 2875edb

Please sign in to comment.