This commit is contained in:
+13
@@ -3,8 +3,10 @@ import { AppModule } from './app.module';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { Logger, ValidationPipe } from '@nestjs/common';
|
||||
import { getSwaggerConfig } from './config/swagger.config';
|
||||
import compress from '@fastify/compress';
|
||||
import multipart from '@fastify/multipart';
|
||||
import fastifyCookie from '@fastify/cookie';
|
||||
import * as zlib from 'zlib';
|
||||
|
||||
// 👈 Import the Fastify application type
|
||||
import { type NestFastifyApplication, FastifyAdapter } from '@nestjs/platform-fastify';
|
||||
@@ -23,6 +25,17 @@ async function bootstrap() {
|
||||
{ logger: ['error', 'warn', 'log', 'debug', 'verbose'] },
|
||||
);
|
||||
|
||||
await app.register(compress, {
|
||||
global: true,
|
||||
encodings: ['br', 'gzip', 'deflate'],
|
||||
threshold: 1024,
|
||||
brotliOptions: {
|
||||
params: {
|
||||
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await app.register(fastifyCookie);
|
||||
|
||||
await app.register(multipart);
|
||||
|
||||
Reference in New Issue
Block a user