🐛 move overrides into core folder (#7371)

closes #7336
- make sure overrides is still the first package to call
This commit is contained in:
Katharina Irrgang 2016-09-14 14:50:17 +00:00 committed by Hannah Wolfe
parent 470000242d
commit 94fdbdd267
3 changed files with 26 additions and 24 deletions

View File

@ -1,6 +1,17 @@
// # Bootup
// This file needs serious love & refactoring
/**
* make sure overrides get's called first!
* - keeping the overrides require here works for installing Ghost as npm!
*
* the call order is the following:
* - root index requires core module
* - core index requires server
* - overrides is the first package to load
*/
require('./overrides');
// Module dependencies
var express = require('express'),
_ = require('lodash'),

View File

@ -1,12 +1,4 @@
var moment = require('moment-timezone'),
_ = require('lodash'),
toPairs = require('lodash.topairs'),
fromPairs = require('lodash.frompairs'),
toString = require('lodash.tostring'),
pickBy = require('lodash.pickby'),
uniqBy = require('lodash.uniqby'),
orderBy = require('lodash.orderby'),
omitBy = require('lodash.omitby');
var moment = require('moment-timezone');
/**
* force UTC
@ -17,6 +9,16 @@ var moment = require('moment-timezone'),
*/
moment.tz.setDefault('UTC');
// jscs:disable
var _ = require('lodash'),
toPairs = require('lodash.topairs'),
fromPairs = require('lodash.frompairs'),
toString = require('lodash.tostring'),
pickBy = require('lodash.pickby'),
uniqBy = require('lodash.uniqby'),
orderBy = require('lodash.orderby'),
omitBy = require('lodash.omitby');
/**
* lodash 4.x functions we use
*/

View File

@ -1,25 +1,14 @@
// # Ghost Startup
// Orchestrates the startup of Ghost when run from command line.
var express,
ghost,
parentApp,
errors;
require('./core/server/overrides');
var ghost = require('./core'),
express = require('express'),
errors = require('./core/server/errors'),
parentApp = express();
// Make sure dependencies are installed and file system permissions are correct.
require('./core/server/utils/startup-check').check();
// Proceed with startup
express = require('express');
ghost = require('./core');
errors = require('./core/server/errors');
// Create our parent express app instance.
parentApp = express();
// Call Ghost to get an instance of GhostServer
ghost().then(function (ghostServer) {
// Mount our Ghost instance on our desired subdirectory path if it exists.
parentApp.use(ghostServer.config.paths.subdir, ghostServer.rootApp);