mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
9dd543231b
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
18 lines
498 B
JavaScript
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; |