backend-core-bm 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/framework.js CHANGED
@@ -21,9 +21,6 @@ module.exports = class Framework {
21
21
  constructor(config = {}) {
22
22
  this.express = express;
23
23
  this.app = express();
24
- this.app.use(bodyParser.json({ type: "application/json" }));
25
- this.app.use(bodyParser.text({ type: "text/*" }));
26
- this.app.use(bodyParser.urlencoded({ extended: true }));
27
24
 
28
25
  config = u.mapMergeDeep(
29
26
  {
@@ -38,6 +35,7 @@ module.exports = class Framework {
38
35
  "pre-terminate": [],
39
36
  },
40
37
  cors: false,
38
+ bodyLimit: "10mb",
41
39
  logger: {
42
40
  devOverride: true,
43
41
  type: "on",
@@ -66,6 +64,10 @@ module.exports = class Framework {
66
64
  );
67
65
  this.config = config;
68
66
 
67
+ this.app.use(bodyParser.json({ type: "application/json", limit: this.config.bodyLimit }));
68
+ this.app.use(bodyParser.text({ type: "text/*", limit: this.config.bodyLimit }));
69
+ this.app.use(bodyParser.urlencoded({ extended: true }));
70
+
69
71
  if (this.config.cors) this.app.use(cors());
70
72
 
71
73
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-core-bm",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "main": "index.js",
5
5
  "description": "utils",
6
6
  "scripts": {
package/typedef.js CHANGED
@@ -7,6 +7,7 @@
7
7
  * @property {{name:string,pattern:string,operation: () => {}}[]} schedule
8
8
  * @property {{"process" : [],"post-process" : [],"pre-terminate" : []}} perform
9
9
  * @property {false} cors
10
+ * @property {"10mb"} bodyLimit
10
11
  * @property {{devOverride:true, type : "on" | "off" | "bunyan-dev" | "bunyan", bunyan : { name : string, baseLevel: "trace" | "debug" | "info" | "warn" | "error" | "fatal" }}} logger
11
12
  * @property {{logger:string, secret:string}} directories
12
13
  * @property {{filename: string, keys: string[], additional: {}}} secret