How to use the koa/lib/application.prototype function in koa

To help you get started, we’ve selected a few 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 astroboy-lab / astroboy / loader / AstroboyExtendLoader.js View on Github external
'use strict';
const requestProto = require('koa/lib/request');
const responseProto = require('koa/lib/response');
const contextProto = require('koa/lib/context');
const applicationProto = require('koa/lib/application').prototype;
const completeAssign = require('complete-assign');
const Loader = require('../core/Loader');
const baseClassProto = require('../core/base/BaseClass').prototype;

class AstroboyExtendLoader extends Loader {
  load() {
    // application extend
    this.globDirs(this.config.applicationPattern, entries => {
      entries.forEach(entry => {
        completeAssign(applicationProto, require(entry));
      });
    });

    // context extend
    this.globDirs(this.config.contextPattern, entries => {
      entries.forEach(entry => {

koa

Koa web app framework

MIT
Latest version published 7 months ago

Package Health Score

93 / 100
Full package analysis