@azteam/express 1.2.130 → 1.2.133

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/ApiServer.js +6 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.130",
3
+ "version": "1.2.133",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@azteam/crypto": "1.0.17",
27
27
  "@azteam/error": "1.0.15",
28
- "@azteam/http-client": "1.0.81",
28
+ "@azteam/http-client": "1.0.82",
29
29
  "body-parser": "1.19.0",
30
30
  "cookie-parser": "1.4.4",
31
31
  "cors": "2.8.4",
package/src/ApiServer.js CHANGED
@@ -117,7 +117,7 @@ class ApiServer {
117
117
  }
118
118
 
119
119
 
120
- startPort(port) {
120
+ startAPI(port) {
121
121
  if (!_.isEmpty(this.controllers)) {
122
122
 
123
123
  const WHITE_LIST = this.whiteList;
@@ -177,8 +177,10 @@ class ApiServer {
177
177
  res.success = function(data = {}, guard = [], allows = []) {
178
178
  let guardData = data;
179
179
  if (data) {
180
- let resType = RES_TYPE.ARRAY;
181
- if (_.isObject(data)) {
180
+ let resType = null;
181
+ if (_.isArray(data)) {
182
+ resType = RES_TYPE.ARRAY;
183
+ } else if (_.isObject(data)) {
182
184
  resType = RES_TYPE.OBJECT;
183
185
  if (data.docs) {
184
186
  resType = RES_TYPE.DOCS;
@@ -341,7 +343,7 @@ class ApiServer {
341
343
  } else {
342
344
  throw Error('No controllers in use');
343
345
  }
344
- return null;
346
+ return this;
345
347
  }
346
348
 
347
349
  setAlertCallback(callback) {