@svenardo/koa-proxy

1.0.2 • Public • Published

Koa 2 Proxy

Installation

Get it from npm with npm install --save @svenardo/koa-proxy

Testing

const koaProxy = require('@svenardo/koa-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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    6
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @svenardo/koa-proxy

Weekly Downloads

6

Version

1.0.2

License

ISC

Last publish

Collaborators

  • svenanders