diff --git a/core/api-server/api/rest-api/app-server.js b/core/api-server/api/rest-api/app-server.js index 940628915..673bbe1b8 100644 --- a/core/api-server/api/rest-api/app-server.js +++ b/core/api-server/api/rest-api/app-server.js @@ -28,7 +28,7 @@ class AppServer { const { schemasInternal, ...swagger } = await swaggerUtils.loader.load({ path: path.join(__dirname, 'swagger') }); swagger.info.version = options.version; - const { prefix, port, rateLimit, poweredBy } = options.rest; + const { prefix, port, rateLimit, poweredBy, bodySizeLimit } = options.rest; const routes = internal(); routes.push(metrics.getRouter()); const versions = fs.readdirSync(path.join(__dirname, 'routes')); @@ -59,6 +59,7 @@ class AppServer { port: parseInt(port, 10), rateLimit, poweredBy, + bodySizeLimit, name: options.serviceName, beforeRoutesMiddlewares, afterRoutesMiddlewares: [...afterRoutesMiddlewares, afterRequest(routeLogBlacklist)] diff --git a/core/api-server/config/main/config.base.js b/core/api-server/config/main/config.base.js index 5162e63f2..6e9751c71 100644 --- a/core/api-server/config/main/config.base.js +++ b/core/api-server/config/main/config.base.js @@ -20,6 +20,7 @@ config.rest = { port: process.env.API_SERVER_REST_PORT || 3000, prefix: 'api', poweredBy: 'HKube Server', + bodySizeLimit: process.env.BODY_SIZE_LIMIT || '2000mb', rateLimit: { route: '/api', ms: process.env.API_SERVER_RATE_LIMIT_MS || 1000,