This is my very basic GET function
app.get('/', function(request, response) {
response.contentType('application/json');
var lid = request.param("lid");
client.llen(lid, function(reply, len){
client.lrange(lid, 0, len-1, function(reply, messages){
console.log(messages);
response.send(messages);
})
});
});
For some reason, the console output and the response i get looks like
[ <Buffer 5b 7b 22 6c 61 77 79 65 72 5f ... 61 64 61 74 61 22 3a 22 36 22 7d 5d> ]
I'm storing these as JSON strings:
client.lpush(lid, JSON.stringify(to_store))
Any ideas why my response is not a JSON string??
Thank you.
Try
console.log(messages.toString());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With