bootstarp.js 742 Bytes

// app - routes

var bootable = require('bootable');

exports = module.exports = function(IoC, settings) {

  var app = this; 
  
  //auth
  app.phase(bootable.di.routes('./routes/auth.js')); 
  
  //mock
  app.phase(bootable.di.routes('./routes/mock.js'));   
  //authed

  app.phase(bootable.di.routes('./routes/authed.js')); 

  //api
  app.phase(bootable.di.routes('./routes/api.js'));

  //file
  app.phase(bootable.di.routes('./routes/file.js'));

  //robot
  app.phase(bootable.di.routes('./routes/robot.js'));

  // error handler (always keep this last)
  app.phase(function() {
    var errorHandler = IoC.create('igloo/error-handler');
    app.use(errorHandler);
  });

};

exports['@require'] = [ '$container', 'igloo/settings' ];