feat(lead-forms): real file upload under 200KB and Jalali date
Public form file fields compress images or reject oversized files; dates use the full Jalali picker.
This commit is contained in:
+13
-1
@@ -1,11 +1,23 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { json, urlencoded } from 'express';
|
||||
import type { Request } from 'express';
|
||||
import { brand } from '@mento/shared';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule, { rawBody: true });
|
||||
// bodyParser خاموش تا سقف ۲ مگ برای پیوست فشردهٔ فرم عمومی + حفظ rawBody برای وبهوک
|
||||
const app = await NestFactory.create(AppModule, { bodyParser: false });
|
||||
app.use(
|
||||
json({
|
||||
limit: '2mb',
|
||||
verify: (req: Request, _res, buf) => {
|
||||
(req as Request & { rawBody?: Buffer }).rawBody = Buffer.from(buf);
|
||||
},
|
||||
}),
|
||||
);
|
||||
app.use(urlencoded({ extended: true, limit: '2mb' }));
|
||||
const config = app.get(ConfigService);
|
||||
|
||||
app.setGlobalPrefix('api');
|
||||
|
||||
Reference in New Issue
Block a user