chanjs 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/core/chan.js CHANGED
@@ -41,7 +41,7 @@ class Chan {
41
41
  const configPath = path.join(config.APP_PATH, "config/index.js");
42
42
  if (fs.existsSync(configPath)) {
43
43
  const config = require(configPath);
44
- Chan.config = Object.assign(Chan.config, config);
44
+ Chan.config = {...Chan.config,...config};
45
45
  }
46
46
  }
47
47
 
@@ -11,6 +11,7 @@ const ROOT_PATH = process.cwd();
11
11
  const APP_PATH = path.join(ROOT_PATH, 'app');
12
12
 
13
13
  let config = {
14
+ JSON_LIMIT:"100kb",
14
15
  logger : {
15
16
  level: 'dev',
16
17
  },
package/core/lib/core.js CHANGED
@@ -7,7 +7,7 @@ const path = require("path");
7
7
  const view = require("./middleware/view.js");
8
8
  module.exports = async function (app) {
9
9
 
10
- const { logger,APP_PATH, cookieKey, maxAge } = app.config;
10
+ const { logger,APP_PATH, cookieKey, maxAge,JSON_LIMIT } = app.config;
11
11
  //日志
12
12
  app.use(morgan(logger.level));
13
13
 
@@ -18,7 +18,7 @@ module.exports = async function (app) {
18
18
  app.use(cookieParser(cookieKey));
19
19
 
20
20
  //解析接口 json & url
21
- app.use(express.json());
21
+ app.use(express.json({ limit: JSON_LIMIT}));
22
22
  app.use(express.urlencoded({ extended: false }));
23
23
 
24
24
  //配置模板引擎
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chanjs",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Chanjs develops a lightweight MVC framework based on express pure JavaScript",
5
5
  "main": "core/chan.js",
6
6
  "module":"core/chan.js",