Browse Source

feat: set max-body size

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
5e02057504
  1. 3
      packages/nocodb-nest/src/Noco.ts
  2. 2
      packages/nocodb-nest/src/main.ts
  3. 8
      packages/nocodb-sdk/src/lib/Api.ts

3
packages/nocodb-nest/src/Noco.ts

@ -98,6 +98,9 @@ export default class Noco {
this._server = server; this._server = server;
const nestApp = await NestFactory.create(AppModule); const nestApp = await NestFactory.create(AppModule);
nestApp.use(
express.json({ limit: process.env.NC_REQUEST_BODY_SIZE || '50mb' }),
);
await nestApp.init(); await nestApp.init();
const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard'; const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard';

2
packages/nocodb-nest/src/main.ts

@ -1,9 +1,11 @@
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import cors from 'cors'; import cors from 'cors';
import express from 'express'
import { AppModule } from './app.module'; import { AppModule } from './app.module';
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule);
app.use(express.json({ limit: process.env.NC_REQUEST_BODY_SIZE || '50mb' }));
app.use( app.use(
cors({ cors({
exposedHeaders: 'xc-db-response', exposedHeaders: 'xc-db-response',

8
packages/nocodb-sdk/src/lib/Api.ts

@ -154,11 +154,13 @@ export interface AuditType {
| 'LINK_RECORD' | 'LINK_RECORD'
| 'UNLINK_RECORD' | 'UNLINK_RECORD'
| 'DELETE' | 'DELETE'
| 'CREATE' | 'CREATED'
| 'RENAME' | 'DELETED'
| 'RENAMED'
| 'IMPORT_FROM_ZIP' | 'IMPORT_FROM_ZIP'
| 'EXPORT_TO_FS' | 'EXPORT_TO_FS'
| 'EXPORT_TO_ZIP' | 'EXPORT_TO_ZIP'
| 'UPDATED'
| 'SIGNIN' | 'SIGNIN'
| 'SIGNUP' | 'SIGNUP'
| 'PASSWORD_RESET' | 'PASSWORD_RESET'
@ -7918,7 +7920,7 @@ export class Api<
path: `/api/v1/db/public/shared-view/${sharedViewUuid}/rows`, path: `/api/v1/db/public/shared-view/${sharedViewUuid}/rows`,
method: 'POST', method: 'POST',
body: data, body: data,
type: ContentType.Json, type: ContentType.FormData,
format: 'json', format: 'json',
...params, ...params,
}), }),

Loading…
Cancel
Save