fix: bug in the content type parser of fastify
This commit is contained in:
+11
-1
@@ -10,7 +10,17 @@ import { PaginationInterceptor } from "./core/interceptors/pagination.intercepto
|
||||
import { ResponseInterceptor } from "./core/interceptors/response.interceptor";
|
||||
async function bootstrap() {
|
||||
const logger = new Logger("APP");
|
||||
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
|
||||
|
||||
const fastifyAdapter = new FastifyAdapter({
|
||||
bodyLimit: 10 * 1024 * 1024,
|
||||
});
|
||||
|
||||
// Add multipart content type parser
|
||||
fastifyAdapter.getInstance().addContentTypeParser("multipart/form-data", (_request, _payload, done) => {
|
||||
done(null);
|
||||
});
|
||||
|
||||
const app = await NestFactory.create<NestFastifyApplication>(AppModule, fastifyAdapter);
|
||||
|
||||
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
|
||||
app.useGlobalInterceptors(new ResponseInterceptor(), new PaginationInterceptor(), new ClassSerializerInterceptor(app.get(Reflector)));
|
||||
|
||||
Reference in New Issue
Block a user