Esempio n. 1
0
 loadRoutes() {
     let routes = [], routesPath = path.join(this._options.root, 'config/routes');
     if (fs.existsSync(routesPath)) {
         for (let filePath of appolo.loader.load(this._options.root, path.join('config', 'routes'))) {
             routes.push.apply(routes, require(filePath));
             this.cachedRequire.push(filePath);
         }
     }
     //load routes
     router_1.default.initialize(this._app, routes);
 }
Esempio n. 2
0
    loadRoutes: function () {
        var routes = [],
            routesPath = path.join(this._options.root, 'config/routes');

        if (fs.existsSync(routesPath)) {
            appolo.loader.load(this._options.root, path.join('config', 'routes'), function (filePath) {

                routes.push.apply(routes, require(filePath));

                this.cachedRequire.push(filePath);
            }.bind(this));
        }

        //load routes
        router.initialize(this.app, routes);
    },
Esempio n. 3
0
    loadCustomConfigurations:function(){
        appolo.loader.load(this._options.root, path.join('config', 'express'), function (filePath) {

            this.cachedRequire.push(filePath);

            var func = require(filePath)

            var args = _.getFunctionArgs(func);

            var dependencies = _.map(args, function (arg) {
                return appolo.inject.getObject(arg);
            });

            func.apply(func, dependencies);

        }.bind(this));
    },