Skip to content

Instantly share code, notes, and snippets.

View Anton-Ivanov-dev's full-sized avatar

Anton-Ivanov-dev

View GitHub Profile
@Anton-Ivanov-dev
Anton-Ivanov-dev / redis.config.ts
Last active October 3, 2025 13:33
Create configuration module for validate redis connection
import { registerAs } from '@nestjs/config';
import { plainToInstance } from 'class-transformer';
import { IsString, IsNotEmpty, IsPort, validateSync } from 'class-validator';
import { ConfigNamespaces } from '../config-namespaces.enum';
class RedisConfig {
@IsString()
@IsNotEmpty()
host: string;