egg-host
A host plugin for egg. It supports modify the host config, just like edit the /etc/hosts
.
Installation
$ npm i egg-host --save
Usage
Enable this plugin
// {app_root}/config/plugin.jsexportshost = enable: true package: 'egg-host'; // config/config.default.jsexportshost = host: 'eggjs.org': '127.0.0.1' mode: 'both' // `agent`,`worker`,`both`;
Overview
egg-host
supports both worker
and agent
host config.
Once this plugin enabled, all network request will be mock by the host config.
config
mode
agent
: only effect the agent procee.worker
: only effect the worker procee.both
: effect both the worker & agent procee.Default is both.
Questions & Suggestions
Please open an issue here.