Skip to content

Commit

Permalink
feat: add interceptors
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphg6 committed Jan 20, 2023
1 parent 4bad6d0 commit 421f93d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { typeOrmConfig } from 'config/typeorm.config';
import { PrometheusModule } from '@willsoto/nestjs-prometheus';
@Module({

import { APP_INTERCEPTOR } from '@nestjs/core';
import { LoggingInterceptor } from './logging.interceptor';
import { MetricsInterceptor } from './metrics.interceptor';

@Module({
imports: [
PrometheusModule.register(),
ConfigModule.forRoot(),
Expand All @@ -27,11 +29,17 @@ import { PrometheusModule } from '@willsoto/nestjs-prometheus';
MenusModule,
],
providers: [
AppService,

AppService,
{
provide: APP_INTERCEPTOR,
useClass: LoggingInterceptor,
},
{
provide: APP_INTERCEPTOR,
useClass: MetricsInterceptor,
},
],

controllers: [AppController],
})
export class AppModule { }

export class AppModule {}

0 comments on commit 421f93d

Please sign in to comment.