2013-11-26 07:22:59 +04:00
|
|
|
// # Ghost bootloader
|
|
|
|
// Orchestrates the loading of Ghost
|
|
|
|
// When run from command line.
|
|
|
|
|
2014-01-05 10:40:53 +04:00
|
|
|
var bootstrap = require('./bootstrap'),
|
|
|
|
errors = require('./server/errorHandling');
|
2013-11-26 07:22:59 +04:00
|
|
|
|
|
|
|
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
|
|
|
|
2014-02-08 19:41:15 +04:00
|
|
|
function startGhost(options) {
|
|
|
|
options = options || {};
|
|
|
|
bootstrap(options.config).then(function () {
|
2013-11-26 07:22:59 +04:00
|
|
|
var ghost = require('./server');
|
2014-02-08 19:41:15 +04:00
|
|
|
ghost(options.app);
|
2013-11-26 07:22:59 +04:00
|
|
|
}).otherwise(errors.logAndThrowError);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = startGhost;
|