数据库插件
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
port: 6379, // Redis port
|
||||
host: "192.168.1.26", // Redis host
|
||||
// username: "", // needs Redis >= 6
|
||||
password: "9715115286",
|
||||
db: 0, // Defaults to 0
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* redis
|
||||
*
|
||||
* 参考文档:
|
||||
* https://github.com/luin/ioredis
|
||||
* https://luin.github.io/ioredis/classes/Redis.html
|
||||
*/
|
||||
const config = require("./config")
|
||||
const Redis = require("ioredis");
|
||||
module.exports = async (app) => {
|
||||
const redis = new Redis(config);
|
||||
app.redis = redis
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user