lib/server.js
function initialize(app, options) {
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};
  if (!app._mukoan.initialized) {
    var config = defaults({}, options, DEFAULT_CONFIGURATION);
    log.info('Starting and configuring Koa server');

    // Setup global error handler and logger
    app.use(middlewares.error(config.error));
    app.on('error', (error) => log.error('Unexpected exception ', error));
    app._mukoan.initialized = true;
  } else {
    log.warn('Trying to initialize the same Koa instance twice (ignoring action)');
  }
}
function initialize(app, options) {
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};
  if (!app._mukoan.initialized) {
    var config = defaults({}, options, DEFAULT_CONFIGURATION);
    log.info('Starting and configuring Koa server');

    // Setup global error handler and logger
    app.use(middlewares.error(config.error));
    app.on('error', (error) => log.error('Unexpected exception ', error));
    app._mukoan.initialized = true;
  } else {
    log.warn('Trying to initialize the same Koa instance twice (ignoring action)');
  }
}
function initialize ( app , options ) { var log = logger . get ( options ) ; app . _mukoan = app . _mukoan || { } ; if ( ! app . _mukoan . initialized ) { var config = defaults ( { } , options , DEFAULT_CONFIGURATION ) ; log . info ( 'Starting and configuring Koa server' ) ; // Setup global error handler and logger app . use ( middlewares . error ( config . error ) ) ; app . on ( 'error' , ( error ) => log . error ( 'Unexpected exception ' , error ) ) ; app . _mukoan . initialized = true ; } else { log . warn ( 'Trying to initialize the same Koa instance twice (ignoring action)' ) ; } }
Configures top level middlewares and
error logging. This should be called before `bootstrap`.

@param  {Object} app A Koa app instance as created by `new Koa()`
@return {Object}     The `app` instance with middleware already declared.
Configures top level middlewares and error logging . This should be called before bootstrap .