js server on an AWS and im trying to do a register page. i get the data from a form, and then by ajax send it to the server which stores the user information in a MongoDB, the ajax goes to the server and the user is stored however i dont get a response from the server. it should send me a json with the message, user already in database.
here i have the ajax request
$.ajax({
type: 'POST',
url: 'http:xxxxxxxxx/api/register',
dataType: "json",
data: data,
contentType: "application/json; charset=utf-8",
success: function(data) {
alert('hola');
}
});
it also says that the request method type is 'OPTION'