Вынес ограничения размеров файлов и директорий в настройки

This commit is contained in:
Book Pauk
2019-02-13 17:54:41 +07:00
parent 298317d352
commit edece5e17f
3 changed files with 7 additions and 7 deletions

View File

@@ -2,8 +2,6 @@ const c = require('./controllers');
const utils = require('./core/utils');
const multer = require('multer');
const maxUploadSize = 50*1024*1024;
function initRoutes(app, connPool, config) {
const misc = new c.MiscController(connPool, config);
const reader = new c.ReaderController(connPool, config);
@@ -22,7 +20,7 @@ function initRoutes(app, connPool, config) {
cb(null, utils.randomHexString(30));
}
});
const upload = multer({ storage, limits: {fileSize: maxUploadSize} });
const upload = multer({ storage, limits: {fileSize: config.maxUploadFileSize} });
//routes
const routes = [