ette-proxy
[![Build Status](https://travis-ci.org/boycgit/ette-proxy.svg?branch=master)](https://travis-ci.org/boycgit/ette-proxy) [![Coverage Status](https://coveralls.io/repos/github/boycgit/ette-proxy/badge.svg?branch=master)](https://coveralls.io/github/boycgit/
Last updated a year ago by jscon .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ette-proxy 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.2.4                                ...           latest (a year ago)

6 Versions

  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |