2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Ghost/index.js
Naz Gargol df7e64fafa
Extracted frontend folder (#10780)
refs #10790

- Moved /core/apps into core/frontend
- Moved /core/server/helpers to /core/frontend/helpers along with /core/server/services/themes
- Changed helper location in overrides
- Moved /core/server/services/routing to /core/frontend/services
- Moved /core/server/services/url to /core/frontend/services
- Moved /core/server/data/meta to /core/frontend/meta
- Moved /core/server/services/rss to /core/frontend/services
- Moved /core/server/data/xml to /core/frontend/services
2019-06-19 11:30:28 +02:00

36 lines
1 KiB
JavaScript

// # Ghost Startup
// Orchestrates the startup of Ghost when run from command line.
var startTime = Date.now(),
debug = require('ghost-ignition').debug('boot:index'),
ghost, express, common, urlService, parentApp;
debug('First requires...');
ghost = require('./core');
debug('Required ghost');
express = require('express');
common = require('./core/server/lib/common');
urlService = require('./core/frontend/services/url');
parentApp = express();
debug('Initialising Ghost');
ghost().then(function (ghostServer) {
// Mount our Ghost instance on our desired subdirectory path if it exists.
parentApp.use(urlService.utils.getSubdir(), ghostServer.rootApp);
debug('Starting Ghost');
// Let Ghost handle starting our server instance.
return ghostServer.start(parentApp)
.then(function afterStart() {
common.logging.info('Ghost boot', (Date.now() - startTime) / 1000 + 's');
});
}).catch(function (err) {
common.logging.error(err);
setTimeout(() => {
process.exit(-1);
}, 100);
});