|
|
@ -1,5 +1,9 @@
|
|
|
|
import mongoose from 'mongoose';
|
|
|
|
import mongoose from 'mongoose';
|
|
|
|
import redis, { RedisClient } from 'redis';
|
|
|
|
import redis, { RedisClient } from 'redis';
|
|
|
|
|
|
|
|
import dotenv from 'dotenv';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Configuring dotenv to read the variable from .env file
|
|
|
|
|
|
|
|
dotenv.config();
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
Create the connection to the database
|
|
|
|
Create the connection to the database
|
|
|
@ -35,6 +39,7 @@ export const createConnectionMongo = (databaseObj: {
|
|
|
|
export const redisClient: RedisClient = redis.createClient({
|
|
|
|
export const redisClient: RedisClient = redis.createClient({
|
|
|
|
host: process.env.REDIS_HOST,
|
|
|
|
host: process.env.REDIS_HOST,
|
|
|
|
port: parseInt(process.env.REDIS_PORT!),
|
|
|
|
port: parseInt(process.env.REDIS_PORT!),
|
|
|
|
|
|
|
|
password: process.env.REDIS_PASSWORD,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
redisClient.on('connect', () => {
|
|
|
|
redisClient.on('connect', () => {
|
|
|
|