forked from nataliemeurer/GhostAzureSetup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (23 loc) · 835 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// # 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);
});