aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--public/scripts/main.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js
index a9edca0..d732b97 100644
--- a/public/scripts/main.js
+++ b/public/scripts/main.js
@@ -1,4 +1,9 @@
const nanoid = require('nanoid');
-var peer = new Peer(nanoid(), {host: '127.0.0.1', port: 4242, path: '/'});
+const userId = nanoid();
+const peer = new Peer(userId, {host: '127.0.0.1', port: 4242, path: '/'});
+
+peer.on('open', id => {
+ console.log('[LOG] Your ID is ' + id)
+});