2015-10-01 00:30:16 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Public node modules.
|
|
|
|
const async = require('async');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* `Strapi.prototype.start()`
|
|
|
|
*
|
|
|
|
* Loads the application, then starts all attached servers.
|
|
|
|
*
|
|
|
|
* @api public
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = function start(configOverride, cb) {
|
|
|
|
const self = this;
|
|
|
|
|
|
|
|
// Callback is optional.
|
|
|
|
cb = cb || function (err) {
|
|
|
|
if (err) {
|
2015-12-02 11:22:13 +01:00
|
|
|
return self.log.error(err);
|
2015-10-01 00:30:16 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
async.series([
|
2015-12-02 11:18:05 +01:00
|
|
|
cb => self.load(configOverride, cb),
|
|
|
|
this.initialize
|
2015-12-02 12:42:34 +01:00
|
|
|
]);
|
2015-10-01 00:30:16 +02:00
|
|
|
};
|