Error in AJAX request for server Node.js. (readyState: 0 and status: 0)

I am making the following AJAX request:

ping () {function
return new Promise ((resolves, reject) => {
$ Ajax ({
Type: "GET"
url: "localhost: 5000 / ping",
success: function (res) {f}
Resolved (RES);
},
error: function (res) {
reject (RES);
}
});
});
}

If I make a request with the use postman for localhost: 5000 / ping It works normally, but when I make the request using AJAX I get the following message in the console:

(), SetRequestHeader (), overrideMimeType: overrideMimeType (), statusCode: statusCode (), abort: abort (), state: state (), state: state, state, state, state, state, state, state, state , state, state, state, always (), catch: catch (), ...}

insert the description of the image here

the app.js of the API in the node is as follows:

const expres = require (& # 39; expres & # 39;);
const bodyParser = require (& # 39; body-parser & # 39;);
const PORT = process.env.PORT || 5000
app = expres ();

(async () => {
test {
app.use (bodyParser.json ());
app.use (bodyParser.urlencoded ({extended: true}));

(loadRoutes () function {
require (& # 39; ./ src / API / routes / ping.js & # 39;) (app);
}) ();

() () () () () () () ()
res.header (& # 39; Access-Control-Allow-Origin & # 39 ;, "*");
res.header (& # 39; Access-Control-Allow-Methods & # 39 ;, & # 39; GET, PUT, POST, DELETE & # 39;);
res.header (& # 39; Access-Control-Allow-Headers & # 39 ;, & # 39; Content-Type & # 39;);
next ();
})

app.get (& # 39; / ping & # 39 ;, (req, res) => {
res.status (200) .json ({date: new Date ()});
});

app.listen (PORT, () => console.log (`Listening on $ {PORT}`))

} catch (ex) {
console.log (x);
}
}) ();

Until recently I was having problems with CORS, I have enabled Access-Control-Allow-Origin in app.js and I do not receive the message of the CORS, but I still have that error in the return when the request is made through AJAX, if it is via postman, works correctly.