新建拦截器nest generate interceptor logging core/interceptors
This commit is contained in:
parent
f887fbcf91
commit
9d695d3f52
|
@ -0,0 +1,7 @@
|
|||
import { LoggingInterceptor } from './logging.interceptor';
|
||||
|
||||
describe('LoggingInterceptor', () => {
|
||||
it('should be defined', () => {
|
||||
expect(new LoggingInterceptor()).toBeDefined();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class LoggingInterceptor implements NestInterceptor {
|
||||
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||
return next.handle();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue