From f13ba3475b6078f8bcf134d593835e3cdbdeeb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl?= <15849319+abcdan@users.noreply.github.com> Date: Sun, 9 Jun 2024 15:41:06 +0200 Subject: [PATCH] dirty fix --- controllers/file.controller.js | 3 --- index.js | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/controllers/file.controller.js b/controllers/file.controller.js index d5f8876..08b3b94 100644 --- a/controllers/file.controller.js +++ b/controllers/file.controller.js @@ -11,9 +11,6 @@ const fileNameLength = parseInt(process.env.FILE_NAME_LENGTH, 10) || 10; const multerOptions = { limits: parseInt(process.env.FILE_MAX_SIZE_MB, 10) * 1024 * 1024, }; -const publicMulterOptions = { - limits: parseInt(process.env.PUBLIC_UPLOAD_SIZE_LIMIT, 10) * 1024 * 1024, -}; let storageEngine; diff --git a/index.js b/index.js index ec0be88..b7d6ba4 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,12 @@ const s3 = require("./engines/s3.engine"); const local = require("./engines/local.engine"); const storageMode = process.env.STORAGE_MODE || "local"; +// Todo: refactor this way. +const fileNameLength = parseInt(process.env.FILE_NAME_LENGTH, 10) || 10; +const multerOptions = { + limits: parseInt(process.env.FILE_MAX_SIZE_MB, 10) * 1024 * 1024, +}; + app.get("/", async (req, res) => { let storageEngine;