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;
const nestApp = await NestFactory.create(AppModule);
nestApp.use(
express.json({ limit: process.env.NC_REQUEST_BODY_SIZE || '50mb' }),
);
await nestApp.init();
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 cors from 'cors';
import express from 'express'
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(express.json({ limit: process.env.NC_REQUEST_BODY_SIZE || '50mb' }));
app.use(
cors({
exposedHeaders: 'xc-db-response',

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

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

Loading…
Cancel
Save