egg-normal-response-x
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

egg-normal-response

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-normal-response-x --save

Usage

// {app_root}/config/plugin.js
exports.normalResponse = {
  enable: true,
  package: 'egg-normal-response-x',
};

Configuration

// {app_root}/config/config.default.js
exports.normalResponse = {
   outSystemError:false,
   systemErrorCode:500,
   userErrorCode:600,
   succeeCode:200,
  ignore: ["/*","*/upload/*","/assets/*","/static/*"]
};

see config/config.default.js for more detail.

Example

error throw new UserRequestError("u-token不能为空","xxx",data);

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-normal-response-x

Weekly Downloads

0

Version

1.1.3

License

MIT

Unpacked Size

7.29 kB

Total Files

8

Last publish

Collaborators

  • qoyf