How to use the awilix-koa.makeClassInvoker 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 lanvige / koa2-boilerplate / app / apis / v1 / healthApi.js View on Github external
export default function (router) {
  // Same trick as the functional API, but using `makeClassInvoker`.
  const api = makeClassInvoker(HealthApi)

  router.get('/v1/health', api('health'))
  router.get('/v1/info', api('info'))
}
github jeffijoe / koa-es7-boilerplate / src / api / classes.js View on Github external
export default function (router) {
  // Same trick as the functional API, but using `makeClassInvoker`.
  const api = makeClassInvoker(ClassesAPI)

  router.get('/api/classes', api('findClasses'))
}
github lanvige / koa2-boilerplate / app / apis / v1 / pagesApi.js View on Github external
export default function (router) {
  // Same trick as the functional API, but using `makeClassInvoker`.
  const api = makeClassInvoker(PagesApi)

  router.get('/v1/slides/:slideId/pages', api('getSlidePages'))
}

awilix-koa

Awilix helpers for Koa

MIT
Latest version published 2 months ago

Package Health Score

64 / 100
Full package analysis

Similar packages