egg-global-header

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i egg-global-header

Weekly Downloads

147

Version

1.0.1

License

MIT

Unpacked Size

5.26 kB

Total Files

6

Last publish

Collaborators

  • xadillax