1.0.0 • Published 8 years ago

koa3-proxy v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

Koa 3 Proxy

Installation

Get it from npm with npm install --save koa3-proxy

Testing

const koaProxy = require('koa3-proxy');
const Router = require('koa-router');
const router = new Router();


router.get("/octocat*", async ctx => 
        ctx.body = await koaProxy(ctx, {
			target:       'https://api.github.com/users',
			changeOrigin: true
		})
			.then(res => res)
			.catch(err => handleError(err))
	)

License

ISC

1.0.0

8 years ago