So i was trying to use socket io now recently, but it does not allow me to connect to the React JS. In console.log it gives me some weird error messages. Take a look at the code down below. I will post a image of React and the localhost.
Server (Express JS):
const app = require("express")();
const bodyParser = require("body-parser");
const cors = require("cors");
const http = require("http").createServer(app);
const io = require("socket.io")(http);
app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
io.on("connect", (socket) => {console.log("connected");});
app.listen(5000, () => console.log(`Running on port...`));