diff --git a/index.html b/index.html new file mode 100644 index 0000000..5fd0af9 --- /dev/null +++ b/index.html @@ -0,0 +1,10 @@ + + +

Hello from the other side, at least I can say that i've tried

+ +

to tell you I'm sorry, for breaking your heart

+ + + + + diff --git a/index.js b/index.js index ca6bb5a..2cd3773 100644 --- a/index.js +++ b/index.js @@ -2,12 +2,18 @@ const express = require('express'); const app = express(); const http = require('http'); const server = http.createServer(app); +const { Server } = require('socket.io'); +const io = new Server(server); app.get('/', (req, res) => { //res.send('

Hello Leonard!

'); res.sendFile(__dirname + '/index.html'); }); +io.on('connection', (socket) => { + console.log('New user connected'); +}); + server.listen(3333, () => { console.log('Listen on port 3333'); }); diff --git a/package.json b/package.json index e3bd897..01346ab 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "author": "", "license": "ISC", "dependencies": { - "express": "^4.22.3" + "express": "^4.22.3", + "socket.io": "^4.8.4" } }