egg-global-header
v1.0.1
Published
Egg plugin for setting response header globally.
Downloads
338
Maintainers
Readme
egg-global-header
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 ownPowered-by
header will be responsed.
Questions && Suggestions
Please open an issue here.