Created
March 27, 2025 18:30
-
-
Save Vatsalya-singhi/68080f9f321cbd0e8ce417e8186b49e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; | |
import { UsersController } from './users.controller'; | |
import { UsersService } from './users.service'; | |
import { LoggerMiddleware } from './logger.middleware'; | |
@Module({ | |
controllers: [UsersController], | |
providers: [UsersService], | |
}) | |
export class UsersModule implements NestModule { | |
configure(consumer: MiddlewareConsumer) { | |
consumer.apply(LoggerMiddleware).forRoutes(UsersController); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment