18 lines
391 B
TypeScript
18 lines
391 B
TypeScript
/**
|
|
* Redis Configuration
|
|
*/
|
|
|
|
export interface RedisConfig {
|
|
host: string;
|
|
port: number;
|
|
password?: string;
|
|
db: number;
|
|
}
|
|
|
|
export const redisConfig = (): RedisConfig => ({
|
|
host: process.env.REDIS_HOST || 'localhost',
|
|
port: parseInt(process.env.REDIS_PORT || '6379', 10),
|
|
password: process.env.REDIS_PASSWORD || undefined,
|
|
db: parseInt(process.env.REDIS_DB || '5', 10),
|
|
});
|