2.0.0-beta.1 • Published 3 years ago

egg-proxy v2.0.0-beta.1

Weekly downloads
98
License
MIT
Repository
github
Last release
3 years ago

egg-proxy

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

request proxy plugin for egg framework. based on koa-proxy

Install

$ npm i egg-proxy --save

Usage

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

Configuration

Single:

// {app_root}/config/config.default.js
exports.proxy = {
  host: 'http://localhost:9000', // target host that matched path will be proxy to
  match: /\/assets/ // path pattern.
};

Multiple:

// {app_root}/config/config.default.js
exports.proxy = [{
  host: 'host1',
  match: /\/assets1/
}, {
  host: 'host2',
  match: /\/assets2/
}];

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

2.0.0-beta.1

3 years ago

1.2.0

4 years ago

1.1.0

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago