Bom dia! Estou tentando criar meu próprio backend em nodeJS, porém ao tentar fazer uma requisição o console apresenta erro de CORS:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3000/socket.io/?EIO=3&transport=polling&t=MbyCeBd. (Reason: CORS request did not succeed).[Learn More]
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3000/socket.io/?EIO=3&transport=polling&t=MbyCg9O. (Reason: CORS request did not succeed)Tentei resolver adicionando seguinte trecho de código:
app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    res.header("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS");
    next();
});Porém o problema persiste, alguma ideia do que pode ser?
 
            