1.0.3 • Published 6 years ago

egg-youch v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

egg-youch

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

Install

$ npm i egg-youch --save

Usage

// {app_root}/config/plugin.js
exports.youch = {
  enable: true,
  package: 'egg-youch',
};

Configuration

// {app_root}/config/config.default.js
exports.youch = {
   env:'local',
   type: 'html',
   jsonError: {
    err: 'errors'
   },
   htmlError: `<h1>errors</h1>`
};

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

Example

when config.env==="prod" the response body will be config.jsonError or config.htmlError to provent error messages show to users. when config.env='local' or else,the response body will contains error messages

Questions & Suggestions

Please open an issue here.

License

MIT

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago