Ghost/core/index.js
Harry Wolff 9dd543231b Adds ability to pass in configFile path when loading
ghost as a npm module

- modifies main script file to allow it to
take in an options object that currently
supports an express instance or a config file path

- added tests
2014-02-08 10:41:15 -05:00

18 lines
498 B
JavaScript

// # Ghost bootloader
// Orchestrates the loading of Ghost
// When run from command line.
var bootstrap = require('./bootstrap'),
errors = require('./server/errorHandling');
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
function startGhost(options) {
options = options || {};
bootstrap(options.config).then(function () {
var ghost = require('./server');
ghost(options.app);
}).otherwise(errors.logAndThrowError);
}
module.exports = startGhost;