mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
410dc39f3e
Refs #3864 - Make sure that require() is able to resolve all dependencies listed in package.json. If packages are missing halt the bootstrap process and display an error and help message for user. - Check that contentPath and its subdirectories exist with the correct permissions. - Check sqlite3 database file is set for read/write access.
30 lines
835 B
JavaScript
30 lines
835 B
JavaScript
// # Ghost bootloader
|
|
// Orchestrates the loading of Ghost
|
|
// When run from command line.
|
|
|
|
var express,
|
|
ghost,
|
|
parentApp,
|
|
errors;
|
|
|
|
// 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();
|
|
|
|
ghost().then(function (ghostServer) {
|
|
// Mount our ghost instance on our desired subdirectory path if it exists.
|
|
parentApp.use(ghostServer.config.paths.subdir, ghostServer.rootApp);
|
|
|
|
// Let ghost handle starting our server instance.
|
|
ghostServer.start(parentApp);
|
|
}).catch(function (err) {
|
|
errors.logErrorAndExit(err, err.context, err.help);
|
|
});
|