Skip to content

Commit 11f512c

Browse files
sample: update 20-cache sample
1 parent 4be791f commit 11f512c

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

sample/20-cache/package-lock.json

Lines changed: 22 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample/20-cache/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"test:e2e": "echo 'No e2e tests implemented yet.'"
2020
},
2121
"dependencies": {
22+
"@nestjs/cache-manager": "1.0.0",
2223
"@nestjs/common": "9.3.12",
2324
"@nestjs/core": "9.3.12",
2425
"@nestjs/platform-express": "9.3.12",

sample/20-cache/src/app.controller.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import {
2-
CacheInterceptor,
3-
Controller,
4-
Get,
5-
UseInterceptors,
6-
} from '@nestjs/common';
1+
import { CacheInterceptor } from '@nestjs/cache-manager';
2+
import { Controller, Get, UseInterceptors } from '@nestjs/common';
73

84
@Controller()
95
@UseInterceptors(CacheInterceptor)

sample/20-cache/src/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { CacheModule, Module } from '@nestjs/common';
1+
import { CacheModule } from '@nestjs/cache-manager';
2+
import { Module } from '@nestjs/common';
23
import { AppController } from './app.controller';
34

45
@Module({

sample/20-cache/src/common/http-cache.interceptor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { CacheInterceptor, ExecutionContext, Injectable } from '@nestjs/common';
1+
import { CacheInterceptor } from '@nestjs/cache-manager';
2+
import { ExecutionContext, Injectable } from '@nestjs/common';
23

34
@Injectable()
45
export class HttpCacheInterceptor extends CacheInterceptor {

0 commit comments

Comments
 (0)