ette-proxy
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.