client.get method does not work in redis for node.js
//blog function
module.exports = {
index: function () {
var data = new Object();
data.ip = base.ip();
var redis = require("redis");
var client = redis.createClient(6379,'192.168.33.10');
client.get("foo",function(err,reply,callback)
{
var x=reply.toString();
});
data.y=x;
return data;
}
};
data.y="bar"
expects but
x is not defined.
where is the problem?