1
I have the following code in the Node :
var express = require('express');
var app = express();
app.get('/api/events', function(req, res, next) {
var events = repositorio.ListAll();
res.json(events);
})
app.get('*', function(req, res) {
res.sendfile('./public/index.html');
});
app.listen(9000);
But I perform the same query returns me on screen :
{"isFulfilled":false,"isRejected":false}
My repositorio.Listall() method is as follows :
ListAll : function (){
return event.findAll().then(function(eventCTX) {
eventCTX
});
},
I think this one
events
It’s a trial, and you should haveevents.then(ev => res.json(ev));
– Sergio
The error continued, I don’t know if it is giving this error due to the fact that my query is in another layer. I believe there would be no problem but...
– Bruno Jesus Santos
Removes the
then(function(eventCTX) {
insideListAll
– Sergio
It worked, thank you
– Bruno Jesus Santos