![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/lib/node_modules/forever/node_modules/broadway/lib/broadway/ |
Upload File : |
/* * bootstrapper.js: Default logic for bootstrapping broadway applications. * * (C) 2011, Nodejitsu Inc. * MIT LICENSE * */ var broadway = require('../broadway'); // // ### bootstrap (app, callback) // #### @app {broadway.App} Application to bootstrap // #### @callback {function} Continuation to respond to when complete. // Bootstraps the specified `app`. // exports.bootstrap = function (app) { app.options['config'] = app.options['config'] || {}; app.options['config'].init = false; app.use(broadway.plugins.config); // // Remove initializers run by the bootstrapper. // delete app.initializers['config']; app.initlist.pop(); // // Set the current environment in the config // app.config.set('env', app.env); }; // // ### bootstrap (app, callback) // #### @app {broadway.App} Application to bootstrap // #### @callback {function} Continuation to respond to when complete. // Runs the initialization step of the bootstrapping process // for the specified `app`. // exports.init = function (app, callback) { broadway.plugins.config.init.call(app, function (err) { if (err) { return callback(err); } if (app.config.get('handleExceptions')) { app.use(broadway.plugins.exceptions, app.options['exceptions'] || {}); } app.use(broadway.plugins.directories, app.options['directories'] || {}); app.use(broadway.plugins.log, app.options['log'] || {}); // // Ensure the `directories` and `log` plugins initialize before // any other plugins. Since we cannot depend on ordering (if they were // manually added) splice the specific indexes // var log = app.initlist.indexOf('log'); app.initlist.unshift.apply( app.initlist, app.initlist.splice(log) ); var directories = app.initlist.indexOf('directories'); app.initlist.unshift.apply( app.initlist, app.initlist.splice(directories) ); // // Put the godot plugin before the log if it exists // var godot = app.initlist.indexOf('godot'); if(~godot) { app.initlist.unshift.apply( app.initlist, app.initlist.splice(godot) ); } callback(); }); };