feat: complete testing, security, dynamic content, and devops overhaul
This commit is contained in:
1 parent
467532713c
commit
40ff169dc2
52 files changed
+3918
-104
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { Module, NestModule, MiddlewareConsumer } from '@nestjs/common';
|
||||
import { PrismaModule } from './prisma/prisma.module';
|
||||
import { ProductsModule } from './products/products.module';
|
||||
import { UsersModule } from './users/users.module';
|
||||
@@ -7,10 +7,41 @@ import { AuthModule } from './auth/auth.module';
|
||||
import { PetsModule } from './pets/pets.module';
|
||||
import { OrdersModule } from './orders/orders.module';
|
||||
import { SettingsModule } from './settings/settings.module';
|
||||
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { MetricsController } from './common/metrics.controller';
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule, RedisModule, ProductsModule, UsersModule, AuthModule, PetsModule, OrdersModule, SettingsModule],
|
||||
controllers: [],
|
||||
providers: [],
|
||||
imports: [
|
||||
PrismaModule,
|
||||
RedisModule,
|
||||
ProductsModule,
|
||||
UsersModule,
|
||||
AuthModule,
|
||||
PetsModule,
|
||||
OrdersModule,
|
||||
SettingsModule,
|
||||
ThrottlerModule.forRoot([{
|
||||
ttl: 60000,
|
||||
limit: 100,
|
||||
}]),
|
||||
],
|
||||
controllers: [MetricsController],
|
||||
providers: [
|
||||
{
|
||||
provide: APP_GUARD,
|
||||
useClass: ThrottlerGuard,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
export class AppModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer
|
||||
.apply((req: any, res: any, next: () => void) => {
|
||||
MetricsController.incrementRequestCount();
|
||||
next();
|
||||
})
|
||||
.exclude('metrics')
|
||||
.forRoutes('*');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user