fix: REDIS_PASS env
This commit is contained in:
@@ -4,14 +4,14 @@ const { createClient } = require("redis");
|
|||||||
const PORT = process.env.PORT || 3000;
|
const PORT = process.env.PORT || 3000;
|
||||||
const REDIS_HOST = process.env.REDIS_HOST || "127.0.0.1";
|
const REDIS_HOST = process.env.REDIS_HOST || "127.0.0.1";
|
||||||
const REDIS_PORT = parseInt(process.env.REDIS_PORT || "6379");
|
const REDIS_PORT = parseInt(process.env.REDIS_PORT || "6379");
|
||||||
const REDIS_PASSWORD = process.env.REDIS_PASSWORD || undefined;
|
const REDIS_PASS = process.env.REDIS_PASS || undefined;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use(express.static("public"));
|
app.use(express.static("public"));
|
||||||
|
|
||||||
const redis = createClient({
|
const redis = createClient({
|
||||||
socket: { host: REDIS_HOST, port: REDIS_PORT },
|
socket: { host: REDIS_HOST, port: REDIS_PORT },
|
||||||
password: REDIS_PASSWORD,
|
password: REDIS_PASS,
|
||||||
});
|
});
|
||||||
|
|
||||||
redis.on("error", (err) => console.error("Redis error:", err.message));
|
redis.on("error", (err) => console.error("Redis error:", err.message));
|
||||||
|
|||||||
Reference in New Issue
Block a user