From 23e55deec7f41045fa8caaffa04053def3a638c3 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 25 Sep 2024 11:54:04 +0530 Subject: [PATCH] feat: use body parser --- server/src/server.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/server.ts b/server/src/server.ts index 6b112e9b..01091bdc 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -6,6 +6,7 @@ import { record, workflow, storage, auth, integration } from './routes'; import { BrowserPool } from "./browser-management/classes/BrowserPool"; import logger from './logger'; import { connectDB, syncDB } from './db/config'; +import bodyParser from 'body-parser'; import cookieParser from 'cookie-parser'; import csrf from 'csurf'; import { SERVER_PORT } from "./constants/config"; @@ -30,6 +31,8 @@ export const io = new Server(server); */ export const browserPool = new BrowserPool(); +app.use(bodyParser.json({ limit: '10mb' })) +app.use(bodyParser.urlencoded({ extended: true, limit: '10mb', parameterLimit: 10000 })); // parse cookies - "cookie" is true in csrfProtection app.use(cookieParser()) app.use(csrfProtection)