I am new to Sails.js. I followed much of the documentation, but am not able to retrieve simple data from my MySql database. When I run the route in my browser - http://localhost:1337/getAllChoices, the browser seems to be hang. I don't see any errors in the browser console either.
In my models folder, I have a Multiplechoice.js
module.exports = {
attributes: {
multiplechoiceid: { type: 'integer'},
description: { type: 'string'}
},
getAllChoices: function(){
return this.description ;
}
}
My route.js contains this: 'get /allchoices': 'HomeController.GetAllChoices'
My HomeController contains this: getallchoices: function(req, res){ return MultipleChoice.getAllChoices(); }
Am I missing something?
Thank you.