I wrote simple JavaScript that should make a request to my server. I opened one more chrome window with turned off security. So I don't have an error connected with CORS.
Here is this JS code:
const registerBtn = document.querySelector('.register-send');
registerBtn.addEventListener('click', function (e) {
const req = new XMLHttpRequest();
req.onload = function () {
console.log('Success');
}
req.open("POST", 'localhost:3000/api/register?name=Roma&username=Roma123&password=120&profileDescription=5&human=man');
req.send();
});
I turned on my server. But, unfortunately, I have an error.
loginOrRegister.js:47 POST localhost:3000/api/register?name=Roma&username=Roma123&password=120&profileDescription=5&human=man net::ERR_UNKNOWN_URL_SCHEME
Please, help!