ette-proxy
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i ette-proxy

Weekly Downloads

10

Version

1.0.3

License

none

Unpacked Size

356 kB

Total Files

12

Last publish

Collaborators

  • jscon