To resolve Node Socket.io 404 (Not Found) error, we connect to the URL and port of the Socket.io server.
For instance, we write
const app = express();
const server = app.listen(3000);
const io = require("socket.io").listen(server);
to call app.listen` to listen to port 3000.
Then we call listen
with server
to add socket.io to our app.
We can then connect to it at the URL with port 3000.