@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

/@svenardo/koa-proxy/

    Package Sidebar

    Install

    npm i @svenardo/koa-proxy

    Weekly Downloads

    6

    Version

    1.0.2

    License

    ISC

    Last publish

    Collaborators

    • svenanders