I am playing around with Parse Server and Node.js at the Moment and I am not very good in it. So i tried to make a call to my Parse Server from the Client.
Client Code:
$(document).ready(function () {
$.ajax({
type: 'GET',
url: '/usernames',
success: function (result) {
console.log(result);
}
})
})
Code in my main.js :
app.get('/usernames', function (req, res) {
var Userquery = new Parse.Query('Gamescore');
var namearray;
Userquery.find().then(function (results) {
for (name in results) {
namearray[name] = results[name].get('playerName');
}
res.success(namearray);
})
})
So after I execute the Code nothing happen and i dont know why exactly.
Thank you for your help :)