@eddaic/nestjs-cacheable
v1.2.0
Published
Cacheable module for DNS caching.
Downloads
790
Maintainers
Readme
nestjs-cacheable
Simple NestJS Module to add DNS cache using szmarczak/cacheable-lookup.
Installation
npm install @eddaic/nestjs-cacheable
Usage
import { CacheableModule, CacheableService } from '@eddaic/nestjs-cacheable';
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
@Module({
imports: [
HttpModule.registerAsync({
imports: [CacheableModule, ConfigModule],
inject: [CacheableService, ConfigService],
useFactory: (cacheable: CacheableService, config: ConfigService) => ({
baseURL: config.get('MY_URL'),
lookup: cacheable.lookup(),
}),
}),
],
providers: [AppService],
})
export class AppModule {}