1.0.1 • Published 6 years ago

egg-global-header v1.0.1

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

egg-global-header

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

Egg plugin for setting response header globally.

Install

$ npm install --save egg-global-header

Usage

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

Configuration

Set the response key-value pairs in the plugin configuration:

// {app_root}/config/config.default.js
exports.globalHeader = {
  'Powered-by': '23333',
  'Cache-Control': 'no-cache',
};

Hint: The header set by egg-global-header won't overwrite existing response header(s).

E.g. if you set Powered-by in other place (maybe in controller or other plugins), then your own Powered-by header will be responsed.

Questions && Suggestions

Please open an issue here.

License

MIT