const redis = require("redis");
const client = createClient({ url: "redis://47.110.39.170:6380" });
const client = redis.createClient("6380", "47.110.39.170");
client.subscribe('test');
// 监听消息
client.on('message', function(channel,msg){
console.log(channel + ':' + msg)
});
前端直连数据库,这么勇的吗?