Skip to content

Commit

Permalink
fix: increase multer file size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenle committed Jul 29, 2023
1 parent 88c7d2b commit 19e7bf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-candles-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blinkk/root-cms': patch
---

fix: increase multer file size limit
10 changes: 7 additions & 3 deletions packages/root-cms/core/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import {Server} from '@blinkk/root';
import multer from 'multer';
import {arrayToCsv, csvToArray} from './csv.js';

const memoryStorage = multer.memoryStorage();
const upload = multer({storage: memoryStorage});

/**
* Registers API middleware handlers.
*/
export function api(server: Server) {
const upload = multer({
storage: multer.memoryStorage(),
limits: {
fileSize: 10 * 1024 * 1024, // 10 MB.
},
});

/**
* Accepts a JSON object containing {headers: [...], rows: [...]} and sends
* an HTTP response with a corresponding CSV file as an attachment.
Expand Down

0 comments on commit 19e7bf2

Please sign in to comment.