b1c77a2279
refs #2001, #7116 - added debug and wired it up: - across several key parts of the boot process - throughout the middleware loading - for requests - at render points for key routes
21 lines
730 B
JavaScript
21 lines
730 B
JavaScript
// # Ghost Startup
|
|
// Orchestrates the startup of Ghost when run from command line.
|
|
var ghost = require('./core'),
|
|
debug = require('debug')('ghost:boot:index'),
|
|
express = require('express'),
|
|
errors = require('./core/server/errors'),
|
|
utils = require('./core/server/utils'),
|
|
parentApp = express();
|
|
|
|
debug('Initialising Ghost');
|
|
ghost().then(function (ghostServer) {
|
|
// Mount our Ghost instance on our desired subdirectory path if it exists.
|
|
parentApp.use(utils.url.getSubdir(), ghostServer.rootApp);
|
|
|
|
debug('Starting Ghost');
|
|
// Let Ghost handle starting our server instance.
|
|
ghostServer.start(parentApp);
|
|
}).catch(function (err) {
|
|
errors.logErrorAndExit(err, err.context, err.help);
|
|
});
|