1.0.3 • Published 2 years ago

ette-proxy v1.0.3

Weekly downloads
20
License
-
Repository
github
Last release
2 years ago

ette-proxy

Build Status Coverage StatusMIT Licence npm version

Proxy middleware for ette. inspired by http-proxy-middleware

  • written in Typescript
  • used with koa style
  • fully tested

Installation

Node.js / Browserify

npm install ette-proxy --save
var proxy = require('ette-proxy');

Global object

Include the pre-built script.

<script src="./dist/index.umd.min.js"></script>

Build & test

npm run build
npm test

Usage

param

notice

as the mechanism of middleware, you should always put proxy middleware before your router middleware:

right way:

   // 需要先挂载代理中间件,否则就错过了
    app.use(proxy(proxyConfig));

    // 然后再挂载路由
    app.use(router.routes());

incorrect way:(will not proxy the router.routes())

    // 先挂载挂载路由
    app.use(router.routes());

    // 后续挂载的代理功能对上述路由就不适用了
    app.use(proxy(proxyConfig));

document

npm run doc

then open the generated out/index.html file in your browser.

License

MIT.

1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

3 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago