fix: Increase request body size limit to 10MB for base64 image uploads
Added express body parser configuration to support base64 image uploads: - Set JSON payload limit to 10MB (up from default 100kb) - Set URL-encoded payload limit to 10MB - This allows users to upload profile photos and child photos via base64 encoding Without this fix, uploading photos would result in 500 Internal Server Error due to payload too large. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,14 @@ import helmet from 'helmet';
|
||||
import { WINSTON_MODULE_NEST_PROVIDER } from 'nest-winston';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
const app = await NestFactory.create(AppModule, {
|
||||
bodyParser: true,
|
||||
rawBody: true,
|
||||
});
|
||||
|
||||
// Increase body size limit for base64 image uploads (10MB)
|
||||
app.use(require('express').json({ limit: '10mb' }));
|
||||
app.use(require('express').urlencoded({ limit: '10mb', extended: true }));
|
||||
|
||||
// Replace default logger with Winston
|
||||
app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));
|
||||
|
||||
Reference in New Issue
Block a user