I developed an REST API using node.js + express + elastic-search. In that i receive a request and send JSON as response. Everything is working fine.
In a particular situation(say /xxx/yyy/zzz?param1) the response is not sent to the front end. My application simply stays ideal doing nothing. My guess is that for this particular route the JSON response is very bulk i think so.
My code is:
app.get('/xxx/yyy/zzz', function(req, res){
return Ctr.getMaster(req, res);
});
DAO.prototype.master = function(callback) {
var query = {
from: 0,
size: 1000000,
index: 'masterdata',
query:"match_all"
}
client.search(query).then(function (resp) {
var obj = {};
obj.count = resp.hits.total;
obj.master = resp.hits.hits;
callback(null, obj);
}, function(error){
console.log(error);
});
};
How can i sort it out. I want to know whether the JSON is the problem? Or something else?/ How can i crack it. Please share your ideas.