import express from "express"; import socketIO from "socket.io"; const PORT = 3001; const app = express(); app.get('/', (req, res) => res.send('Hello World!')); const server = app.listen(PORT, () => console.log(`Example app listening on port ${PORT}!`)); const io = socketIO(server); io.on('connection', socket => { console.log('a user connected'); });