From c283ae33a3038b98cf05ea483c5663a233f1987b Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Wed, 16 Aug 2023 17:46:45 -0700 Subject: [PATCH] set large limit on express server requests --- server/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index f309e8ac..590cc133 100644 --- a/server/index.js +++ b/server/index.js @@ -19,12 +19,14 @@ const { utilEndpoints } = require("./endpoints/utils"); const { Telemetry } = require("./models/telemetry"); const app = express(); const apiRouter = express.Router(); +const FILE_LIMIT = "3GB"; app.use(cors({ origin: true })); -app.use(bodyParser.text()); -app.use(bodyParser.json()); +app.use(bodyParser.text({ limit: FILE_LIMIT })); +app.use(bodyParser.json({ limit: FILE_LIMIT })); app.use( bodyParser.urlencoded({ + limit: FILE_LIMIT, extended: true, }) );