fix(api): inscription parent — body 15mb, uploads persistants, 409 si unique PG
- NestExpressApplication + useBodyParser json/urlencoded 15mb - UPLOAD_PHOTOS_DIR: résolution chemin absolu/relatif + doc .env.example / proxy - docker-compose: volume backend_uploads + UPLOAD_PHOTOS_DIR par défaut - Map erreur PostgreSQL 23505 → ConflictException (parent + AM) - Logs Nest si échec SMTP après inscription (email déjà géré) Made-with: Cursor
This commit is contained in:
+8
-2
@@ -1,4 +1,5 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { NestExpressApplication } from '@nestjs/platform-express';
|
||||
import { AppModule } from './app.module';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { SwaggerModule } from '@nestjs/swagger/dist/swagger-module';
|
||||
@@ -7,8 +8,13 @@ import { ValidationPipe } from '@nestjs/common';
|
||||
import { LogRequestInterceptor } from './common/interceptors/log-request.interceptor';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule,
|
||||
{ logger: ['error', 'warn', 'log', 'debug', 'verbose'] });
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
|
||||
logger: ['error', 'warn', 'log', 'debug', 'verbose'],
|
||||
});
|
||||
|
||||
// Photos inscription (base64) : limite Express par défaut ~100 ko → 413/500 sans ceci
|
||||
app.useBodyParser('json', { limit: '15mb' });
|
||||
app.useBodyParser('urlencoded', { extended: true, limit: '15mb' });
|
||||
|
||||
// Log de chaque appel API si LOG_API_REQUESTS=true (mode debug)
|
||||
app.useGlobalInterceptors(new LogRequestInterceptor());
|
||||
|
||||
Reference in New Issue
Block a user