egg-redis安装使用

一、安装

npm install --save egg-redis

二、启用插件

app => config => plugin.js

redis: {
enable: true,
package: 'egg-redis',
},

三、配置redis连接

app => config => config.{env}.js

redis: {
client: {
port: 6379,
host: '127.0.0.1',
password: '',
db: 0,
},
},
posted @ 2022-02-17 16:35  随风&  阅读(811)  评论(0编辑  收藏  举报