mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
18 lines
468 B
JavaScript
18 lines
468 B
JavaScript
import fs from "fs";
|
|
import Redis from "ioredis";
|
|
import yaml from "js-yaml";
|
|
import path from "path";
|
|
|
|
const configPath = path.join(process.cwd(), "../../../", "config", 'config', 'redis.yaml');
|
|
|
|
const yamlContent = await fs.promises.readFile(configPath, 'utf8');
|
|
const config = yaml.load(yamlContent);
|
|
|
|
export const redis = new Redis({
|
|
port: config.port,
|
|
host: config.host,
|
|
username: config.username,
|
|
password: config.password,
|
|
db: config.db,
|
|
})
|