0b2940d587
refs #6982 - do not add the subdir property as static config value - create functions to read subdir and protected slugs on runtime
19 lines
623 B
JavaScript
19 lines
623 B
JavaScript
// # Ghost Startup
|
|
// Orchestrates the startup of Ghost when run from command line.
|
|
|
|
var ghost = require('./core'),
|
|
express = require('express'),
|
|
errors = require('./core/server/errors'),
|
|
utils = require('./core/server/utils'),
|
|
parentApp = express();
|
|
|
|
ghost().then(function (ghostServer) {
|
|
// Mount our Ghost instance on our desired subdirectory path if it exists.
|
|
parentApp.use(utils.url.getSubdir(), ghostServer.rootApp);
|
|
|
|
// Let Ghost handle starting our server instance.
|
|
ghostServer.start(parentApp);
|
|
}).catch(function (err) {
|
|
errors.logErrorAndExit(err, err.context, err.help);
|
|
});
|