lib/server.js
function bootstrap(app, options) {
  var config = defaults({}, options, DEFAULT_CONFIGURATION);
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};

  if (!app._mukoan.initialized) {
    initialize(app, options);
  }

  if (!app._mukoan.bootstrapped) {
    // Configure and setup middlewares
    app.use(middlewares.bodyparser(config.bodyParser));
    app.use(middlewares.morgan(config.morgan.format, config.morgan.options));
    app.use(middlewares.responseTime());
    app.use(middlewares.helmet(config.helmet));
    app.use(middlewares.compress({
      flush: zlib.Z_SYNC_FLUSH
    }));
    app.use(middlewares.conditional());
    app.use(middlewares.etag());
    app.use(middlewares.cacheControl(config.cacheControl));
    app.use(middlewares.cors(config.cors));
    app.use(middlewares.favicon(config.favicon));
    app.use(middlewares.jwt(config.jwt.options).unless(config.jwt.unless));
    app.use(middlewares.json());
    app._mukoan.bootstrapped = true;
    log.debug('Finished configuring Koa server');
  } else {
    log.warn('Trying to bootstrap the same Koa instance twice (ignoring action)');
  }
  return app;
}
function bootstrap(app, options) {
  var config = defaults({}, options, DEFAULT_CONFIGURATION);
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};

  if (!app._mukoan.initialized) {
    initialize(app, options);
  }

  if (!app._mukoan.bootstrapped) {
    // Configure and setup middlewares
    app.use(middlewares.bodyparser(config.bodyParser));
    app.use(middlewares.morgan(config.morgan.format, config.morgan.options));
    app.use(middlewares.responseTime());
    app.use(middlewares.helmet(config.helmet));
    app.use(middlewares.compress({
      flush: zlib.Z_SYNC_FLUSH
    }));
    app.use(middlewares.conditional());
    app.use(middlewares.etag());
    app.use(middlewares.cacheControl(config.cacheControl));
    app.use(middlewares.cors(config.cors));
    app.use(middlewares.favicon(config.favicon));
    app.use(middlewares.jwt(config.jwt.options).unless(config.jwt.unless));
    app.use(middlewares.json());
    app._mukoan.bootstrapped = true;
    log.debug('Finished configuring Koa server');
  } else {
    log.warn('Trying to bootstrap the same Koa instance twice (ignoring action)');
  }
  return app;
}
function bootstrap ( app , options ) { var config = defaults ( { } , options , DEFAULT_CONFIGURATION ) ; var log = logger . get ( options ) ; app . _mukoan = app . _mukoan || { } ; if ( ! app . _mukoan . initialized ) { initialize ( app , options ) ; } if ( ! app . _mukoan . bootstrapped ) { // Configure and setup middlewares app . use ( middlewares . bodyparser ( config . bodyParser ) ) ; app . use ( middlewares . morgan ( config . morgan . format , config . morgan . options ) ) ; app . use ( middlewares . responseTime ( ) ) ; app . use ( middlewares . helmet ( config . helmet ) ) ; app . use ( middlewares . compress ( { flush : zlib . Z_SYNC_FLUSH } ) ) ; app . use ( middlewares . conditional ( ) ) ; app . use ( middlewares . etag ( ) ) ; app . use ( middlewares . cacheControl ( config . cacheControl ) ) ; app . use ( middlewares . cors ( config . cors ) ) ; app . use ( middlewares . favicon ( config . favicon ) ) ; app . use ( middlewares . jwt ( config . jwt . options ) . unless ( config . jwt . unless ) ) ; app . use ( middlewares . json ( ) ) ; app . _mukoan . bootstrapped = true ; log . debug ( 'Finished configuring Koa server' ) ; } else { log . warn ( 'Trying to bootstrap the same Koa instance twice (ignoring action)' ) ; } return app ; }
Sets up a Koa app instance.

@param  {Object} app A Koa app instance as created by `new Koa()`
@return {Object}     The `app` instance with middleware already declared.
Sets up a Koa app instance .