dalao-proxy
Version:
An expandable HTTP proxy based on the plug-in system for frontend developers with request caching request mock and development!
19 lines (18 loc) • 514 B
JavaScript
const { Plugin, register } = require('../../../plugin');
module.exports = function getPluginConfig(pluginName, cb) {
if (pluginName) {
const plugin = new Plugin(pluginName, this.context);
cb({
config: plugin.config,
defaultConfig: plugin.parser({})
});
}
else {
register.on('context:config', value => {
cb({
config: value,
defaultConfig: this.context.defaultConfig,
});
});
}
}