Hi,
I’m using express to build an api and I’m not getting any data or error back from this GET.
Any ideas?
$.ajax({
url:/userinfo
,
method:‘GET’,
dataType: ‘json’,
data: {username:this.username, password:this.password, win:this.win, loss:this.loss},
success: function(result){
console.log(result);
},
error:function(err){
console.log(err);
}
});
I don’t want to post my entire server file, I’m using app to call express here fyi.
app.get(’/public.userinfo’,(request, response) => {
client.query('SELECT * FROM userinfo WHERE userin_id, username=$1 AND password=$2 '[request.body.username, request.body.password],
result => response.send(result.row)
)
.catch(console.error);
});