add file upload size limit

This commit is contained in:
Arnaud D. Natali 2023-10-02 23:46:43 +02:00 committed by GitHub
commit 19ce3d0dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ const storage = multer.memoryStorage();
rootUrl,
middlwares: [
cors({ origin: "*" }),
multer({ storage: storage }).single("file"),
multer({ storage: storage, limits: { fileSize: 32000000 } }).single("file"), //32 MB maximum
bodyParser.urlencoded({ extended: true }),
bodyParser.json(),
],