How to use the awilix-koa.makeInvoker function in awilix-koa

To help you get started, we’ve selected a few awilix-koa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeffijoe / koa-es7-boilerplate / src / api / functional.js View on Github external
export default function (router) {
  // What's this?
  // This trick lets us construct an API for each request.
  // That means that it may store request-local state.
  const api = makeInvoker(makeFunctionalApi)
  // router is a KoaRouter.
  router
    .get('/api/functional', api('getStuff'))
    .post('/api/functional', api('postStuff'))
}
github antoinechalifour / memento / src / application / http / request / handler.ts View on Github external
ctx.request.rawBody || ''
    );

    const cookies = response.cookies;

    if (cookies.length > 0) {
      ctx.set('set-cookie', cookies);
    }

    ctx.status = response.status;
    ctx.set(response.headers);
    ctx.body = response.body;
  }
}

const handler = makeInvoker(RequestHandler);

export const respondToRequest = handler('respondToRequest');

awilix-koa

Awilix helpers for Koa

MIT
Latest version published 10 months ago

Package Health Score

52 / 100
Full package analysis

Similar packages