文档没看懂
{"redis-2.2":[
{
"name":"redis-example",
"label":"redis-2.2",
"plan":"free",
"tags":["redis","redis-2.2","key-value","nosql"],
"credentials":{
"hostname":"10.7.66.164",
"host":"10.7.66.164",
"port":5004,
"password":"191dc43f-69a3-4d31-ac5e-4b66155b2e8e",
"name":"9e3f3a9c-82ba-4c2e-bc83-b498e5447251"
}
}
]}
是不是要这样写
var options = {
host: '10.7.66.164',
hostname:'10.7.66.164',
port: 5004,
prefix: 'chs-sess',
pass:这里怎么写?
还有有这里貌似没有写name的选项
}
app.use(express.cookieParser());
app.use(express.session({ store: new RedisStore(options), secret: 'zclcat' }))
还有prefix有什么用
6 回复
https://docs.appfog.com/add-ons/rediscloud#rediscloud-node
var redis = require('redis');
var url = require('url');
var redisURL = url.parse(process.env.REDISCLOUD_URL);
var client = redis.createClient(redisURL.port, redisURL.hostname, {no_ready_check: true});
client.auth(redisURL.auth.split(":")[1]);