internal server error when I’m using fetch api
I checked the api using postman its working fine
code
const authSubmitHandler = async event=>{
event.preventDefault();
// AuthContext.login();
const data = new FormData(event.target);
// console.log(data.get('email'));
// console.log(data.get('name'));
// console.log(data.get('password'));
if(this.state.isLogin){}
else{
try{
const response = await fetch('http://localhost:5000/api/users/signup',
{
method:'POST',
headers:{
'Content-Type':'application/json'
},
body:JSON.stringify(data)
});
const responseData = response.json();
console.log(responseData);
}
catch(err){
console.log(err);
}
}
}