const express = require('express')
const app = express()
const io = require('socket.io')(3000)
app.get('/', (request, response) => {
response.sendFile(__dirname + '/index.html')
})
io.on('connection', socket => {
console.log('A user connected!')
socket.on('disconnect', () => {
console.log('A user disconnected!')
})
})
app.listen(3000, () => {
console.log('Сервер запущен на порте: 3000')
})
// Error: listen EADDRINUSE: address already in use :::3000