Browse Source

Increase file size limit for imports

pull/1726/head
jason-feng 3 years ago
parent
commit
d650fef518
  1. 5
      apps/api/src/main.ts
  2. 6019
      test/import/ok-large-activities.json

5
apps/api/src/main.ts

@ -1,6 +1,7 @@
import { Logger, ValidationPipe, VersioningType } from '@nestjs/common'; import { Logger, ValidationPipe, VersioningType } from '@nestjs/common';
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import * as bodyParser from 'body-parser';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
import { environment } from './environments/environment'; import { environment } from './environments/environment';
@ -33,6 +34,10 @@ async function bootstrap() {
}) })
); );
// support 10mb csv/json files for importing activities
app.use(bodyParser.json({ limit: '10mb' }));
app.use(bodyParser.urlencoded({ limit: '10mb', extended: true }));
const HOST = configService.get<string>('HOST') || '0.0.0.0'; const HOST = configService.get<string>('HOST') || '0.0.0.0';
const PORT = configService.get<number>('PORT') || 3333; const PORT = configService.get<number>('PORT') || 3333;
await app.listen(PORT, HOST, () => { await app.listen(PORT, HOST, () => {

6019
test/import/ok-large-activities.json

File diff suppressed because it is too large
Loading…
Cancel
Save