feat: integrate Hono with NestJS and add logging middleware

This commit is contained in:
2026-01-11 00:38:29 +07:00
parent e1e1d9cb7b
commit f80ea881c6
10 changed files with 732 additions and 63 deletions

View File

@@ -1,6 +1,7 @@
import { Module } from '@nestjs/common';
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { LoggerMiddleware } from './middleware';
@Module({
imports: [
@@ -13,4 +14,9 @@ import { AppService } from './app.service';
AppService, // hono-di:providers
],
})
export class AppModule {}
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(LoggerMiddleware).forRoutes('*');
}
}