Client-Side Code:
$.ajax({
url: '/testdb',
method: 'POST',
contentType: 'application/json',
data: JSON.stringify({
mssg: "idea"
}),
success: ({mssg}) => {
if(mssg === true){
//location.replace(document.referrer);
alert("success")
//var readerId = document.querySelector(".checkProfile").innerHTML.replace(/\s/g, '');
//location.assign('index');
}else{
alert("failure")
}
}
})
this is the client code when making request. But the server code does not receive the request on cpanel, and i am sure it works on localhost.
Server-Side Code
router.post("/testdb", parser, test);