bootstarp.js 1.0 KB
/*
 * @Descripttion: 
 * @version: 0.0.0
 * @Author: genglw
 * @Date: 2022-01-21 15:31:14
 * @LastEditors: genglw
 * @LastEditTime: 2022-02-10 20:46:00
 */

// 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'));

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

  app.phase(bootable.di.routes('./routes/config.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' ];